Struct StdFmtWrite
struct StdFmtWrite<W>(2136)
An adapter for using std::fmt::Write implementations with fmt::Write.
This is useful when one wants to format a datetime or span directly
to something with a std::fmt::Write trait implementation but not a
fmt::Write implementation.
(Despite using Std in this name, this type is available in core-only
configurations.)
Example
This example shows the std::fmt::Display trait implementation for
civil::DateTime (but using a wrapper type).
use ;
;
let dt = MyDateTime;
assert_eq!;
Implementations
impl<T> Any for StdFmtWrite<W>
fn type_id(self: &Self) -> TypeId
impl<T> Borrow for StdFmtWrite<W>
fn borrow(self: &Self) -> &T
impl<T> BorrowMut for StdFmtWrite<W>
fn borrow_mut(self: &mut Self) -> &mut T
impl<T> CloneToUninit for StdFmtWrite<W>
unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)
impl<T> From for StdFmtWrite<W>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for StdFmtWrite<W>
fn to_owned(self: &Self) -> Tfn clone_into(self: &Self, target: &mut T)
impl<T, U> Into for StdFmtWrite<W>
fn into(self: Self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom for StdFmtWrite<W>
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
impl<T, U> TryInto for StdFmtWrite<W>
fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>
impl<W> Freeze for StdFmtWrite<W>
impl<W> RefUnwindSafe for StdFmtWrite<W>
impl<W> Send for StdFmtWrite<W>
impl<W> Sync for StdFmtWrite<W>
impl<W> Unpin for StdFmtWrite<W>
impl<W> UnwindSafe for StdFmtWrite<W>
impl<W: $crate::clone::Clone> Clone for StdFmtWrite<W>
fn clone(self: &Self) -> StdFmtWrite<W>
impl<W: $crate::fmt::Debug> Debug for StdFmtWrite<W>
fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result
impl<W: Write> Write for StdFmtWrite<W>
fn write_str(self: &mut Self, string: &str) -> Result<(), core::fmt::Error>
impl<W: core::fmt::Write> Write for StdFmtWrite<W>
fn write_str(self: &mut Self, string: &str) -> Result<(), Error>