pub struct Delimited<T, Span> {
pub span: Span,
pub inner: T,
}Expand description
A value enclosed by delimiters (e.g., brackets, braces, parentheses).
Stores the combined span of the delimiters and the inner content.
Use this to represent constructs like [items], {block}, or (expr).
§Type Parameters
T: The inner content typeSpan: The span type for source positions
§Example
ⓘ
// Parse: [1, 2, 3]
let bracket = bracket!(inner in stream);
// `inner` is a TokenStream of "1, 2, 3"
// `bracket` is Delimited with span covering "[...]"
let items: Punctuated<Expr, Comma> = inner.parse()?;Fields§
§span: SpanThe span covering the entire delimited region (including delimiters).
inner: TThe inner content between the delimiters.
Implementations§
Trait Implementations§
impl<T, Span> StructuralPartialEq for Delimited<T, Span>
Auto Trait Implementations§
impl<T, Span> Freeze for Delimited<T, Span>
impl<T, Span> RefUnwindSafe for Delimited<T, Span>where
Span: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, Span> Send for Delimited<T, Span>
impl<T, Span> Sync for Delimited<T, Span>
impl<T, Span> Unpin for Delimited<T, Span>
impl<T, Span> UnwindSafe for Delimited<T, Span>where
Span: UnwindSafe,
T: UnwindSafe,
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
Mutably borrows from an owned value. Read more