Enum Item
pub enum Item<'a>
A single formatting item. This is used for both formatting and parsing.
Variants
-
Literal(&'a str) A literally printed and parsed text.
-
OwnedLiteral(Box<str>) Same as
Literalbut with the string owned by the item.-
Space(&'a str) Whitespace. Prints literally but reads zero or more whitespace.
-
OwnedSpace(Box<str>) Same as
Spacebut with the string owned by the item.-
Numeric(Numeric, Pad) Numeric item. Can be optionally padded to the maximal length (if any) when formatting; the parser simply ignores any padded whitespace and zeroes.
-
Fixed(Fixed) Fixed-format item.
-
Error Issues a formatting error. Used to signal an invalid format string.
Implementations
impl Item<'_>
fn to_owned(self) -> Item<'static>Convert items that contain a reference to the format string into an owned variant.
Trait Implementations
impl<'a> Clone for Item<'a>
fn clone(&self) -> Self
impl<'a> Debug for Item<'a>
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl<'a> Eq for Item<'a>
impl<'a> Hash for Item<'a>
fn hash<__H: Hasher>(&self, state: &mut __H)
impl<'a> PartialEq for Item<'a>
fn eq(&self, other: &Self) -> bool
impl<'a> StructuralPartialEq for Item<'a>
Auto Trait Implementations
impl<'a> Freeze for Item<'a>
impl<'a> RefUnwindSafe for Item<'a>
impl<'a> Send for Item<'a>
impl<'a> Sync for Item<'a>
impl<'a> Unpin for Item<'a>
impl<'a> UnsafeUnpin for Item<'a>
impl<'a> UnwindSafe for Item<'a>
Blanket Implementations
impl<T> Any for Item<'a>
where
T: 'static + ?Sized,
fn type_id(&self) -> TypeId
impl<T> Borrow<T> for Item<'a>
where
T: ?Sized,
fn borrow(&self) -> &T
impl<T> BorrowMut<T> for Item<'a>
where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
impl<T> CloneToUninit for Item<'a>
where
T: Clone,
unsafe fn clone_to_uninit(&self, dest: *mut u8)
impl<T> From<T> for Item<'a>
fn from(t: T) -> TReturns the argument unchanged.
impl<T> ToOwned for Item<'a>
where
T: Clone,
type Owned = T;fn to_owned(&self) -> Tfn clone_into(&self, target: &mut T)
impl<T, U> Into<U> for Item<'a>
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 Item<'a>
where
U: Into<T>,
type Error = never;fn try_from(value: U) -> Result<T, never>
impl<T, U> TryInto<U> for Item<'a>
where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error;fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>