Struct DelayedFormat
pub struct DelayedFormat<I> { /* private fields */ }
A temporary object which can be used as an argument to format! or others.
This is normally constructed via format methods of each date and time type.
Implementations
impl<'a, I: Iterator<Item = B> + Clone, B: Borrow<Item<'a>>> DelayedFormat<I>
fn new(date: Option<NaiveDate>, time: Option<NaiveTime>, items: I) -> DelayedFormat<I>Makes a new
DelayedFormatvalue out of local date and time.fn new_with_offset<Off>(date: Option<NaiveDate>, time: Option<NaiveTime>, offset: &Off, items: I) -> DelayedFormat<I> where Off: Offset + Display,Makes a new
DelayedFormatvalue out of local date and time and UTC offset.fn write_to(&self, w: &mut impl Write + ?Sized) -> ResultFormats
DelayedFormatinto acore::fmt::Writeinstance.Errors
This function returns a
core::fmt::Errorif formatting into thecore::fmt::Writeinstance fails.Example
Writing to a String
let dt = from_timestamp.unwrap; let df = dt.format; let mut buffer = Stringnew; let _ = df.write_to;
Trait Implementations
impl<'a, I: Iterator<Item = B> + Clone, B: Borrow<Item<'a>>> Display for DelayedFormat<I>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<I: Debug> Debug for DelayedFormat<I>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
Auto Trait Implementations
impl<I> Freeze for DelayedFormat<I>
where
I: Freeze,
impl<I> RefUnwindSafe for DelayedFormat<I>
where
I: RefUnwindSafe,
impl<I> Send for DelayedFormat<I>
where
I: Send,
impl<I> Sync for DelayedFormat<I>
where
I: Sync,
impl<I> Unpin for DelayedFormat<I>
where
I: Unpin,
impl<I> UnsafeUnpin for DelayedFormat<I>
where
I: UnsafeUnpin,
impl<I> UnwindSafe for DelayedFormat<I>
where
I: UnwindSafe,
Blanket Implementations
impl<T> Any for DelayedFormat<I>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for DelayedFormat<I>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for DelayedFormat<I>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> From<T> for DelayedFormat<I>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToString for DelayedFormat<I>
where
T: Display + ?Sized,
fn to_string(&self) -> String
impl<T, U> Into<U> for DelayedFormat<I>
where
U: From<T>,
fn into(self) -> UCalls
U::from(self).That is, this conversion is whatever the implementation of
[From]<T> for Uchooses to do.
impl<T, U> TryFrom<U> for DelayedFormat<I>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for DelayedFormat<I>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>