pub(super) enum Item<'a> {
Literal(Spanned<&'a [u8]>),
EscapedBracket {
_first: Unused<Location>,
_second: Unused<Location>,
},
Component {
_opening_bracket: Unused<Location>,
_leading_whitespace: Unused<Option<Spanned<&'a [u8]>>>,
name: Spanned<&'a [u8]>,
modifiers: Box<[Modifier<'a>]>,
_trailing_whitespace: Unused<Option<Spanned<&'a [u8]>>>,
_closing_bracket: Unused<Location>,
},
Optional {
opening_bracket: Location,
_leading_whitespace: Unused<Option<Spanned<&'a [u8]>>>,
_optional_kw: Unused<Spanned<&'a [u8]>>,
_whitespace: Unused<Spanned<&'a [u8]>>,
nested_format_description: NestedFormatDescription<'a>,
closing_bracket: Location,
},
First {
opening_bracket: Location,
_leading_whitespace: Unused<Option<Spanned<&'a [u8]>>>,
_first_kw: Unused<Spanned<&'a [u8]>>,
_whitespace: Unused<Spanned<&'a [u8]>>,
nested_format_descriptions: Box<[NestedFormatDescription<'a>]>,
closing_bracket: Location,
},
}
formatting
or parsing
) and crate feature alloc
only.Expand description
One part of a complete format description.
Variants§
Literal(Spanned<&'a [u8]>)
A literal string, formatted and parsed as-is.
This should never be present inside a nested format description.
EscapedBracket
A sequence of brackets. The first acts as the escape character.
This should never be present if the lexer has BACKSLASH_ESCAPE
set to true
.
Component
Part of a type, along with its modifiers.
Fields
_leading_whitespace: Unused<Option<Spanned<&'a [u8]>>>
Whitespace between the opening bracket and name.
Optional
An optional sequence of items.
Fields
_leading_whitespace: Unused<Option<Spanned<&'a [u8]>>>
Whitespace between the opening bracket and “optional”.
_whitespace: Unused<Spanned<&'a [u8]>>
Whitespace between the “optional” keyword and the opening bracket.
nested_format_description: NestedFormatDescription<'a>
The items within the optional sequence.
First
The first matching parse of a sequence of items.
Fields
_leading_whitespace: Unused<Option<Spanned<&'a [u8]>>>
Whitespace between the opening bracket and “first”.
_whitespace: Unused<Spanned<&'a [u8]>>
Whitespace between the “first” keyword and the opening bracket.
nested_format_descriptions: Box<[NestedFormatDescription<'a>]>
The sequences of items to try.
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> SizedTypeProperties for T
impl<T> SizedTypeProperties for T
Source§#[doc(hidden)] const IS_ZST: bool = _
#[doc(hidden)] const IS_ZST: bool = _
sized_type_properties
)Source§#[doc(hidden)] const LAYOUT: Layout = _
#[doc(hidden)] const LAYOUT: Layout = _
sized_type_properties
)Source§#[doc(hidden)] const MAX_SLICE_LEN: usize = _
#[doc(hidden)] const MAX_SLICE_LEN: usize = _
sized_type_properties
)[Self]
. Read more