pub enum Item<'a> {
Literal(&'a str),
OwnedLiteral(Box<str>),
Space(&'a str),
OwnedSpace(Box<str>),
Numeric(Numeric, Pad),
Fixed(Fixed),
Error,
}
Expand description
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>)
alloc
only.Same as Literal
but with the string owned by the item.
Space(&'a str)
Whitespace. Prints literally but reads zero or more whitespace.
OwnedSpace(Box<str>)
alloc
only.Same as Space
but 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§
Trait Implementations§
impl<'a> Eq for Item<'a>
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> UnwindSafe for Item<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 24 bytes
Size for each variant:
Literal
: 23 bytesOwnedLiteral
: 23 bytesSpace
: 23 bytesOwnedSpace
: 23 bytesNumeric
: 2 bytesFixed
: 1 byteError
: 0 bytes