pub struct Delimited<S, D> {
pub delimiter: D,
pub contents: S,
}Expand description
Syntax contained by a statically known delimiter family.
D is normally named through crate::Delimiter!, for example
Delimited<S, Delimiter![()]>. The delimiter retains both boundary spans,
while contents owns the syntax between them.
use m2_syn::{Span, ToTokens};
type ParenthesizedPlus = m2_syn::paren!(m2_syn::Token![+]);
let value: ParenthesizedPlus = m2_syn::paren!(
m2_syn::Token),
Span::detached(),
);
assert_eq!(value.to_m2(), "(+)");Fields§
§delimiter: DThe typed delimiter family and its two boundary spans.
contents: SThe syntax enclosed or terminated by the delimiter.
Implementations§
Trait Implementations§
impl<S: Eq, D: Eq> Eq for Delimited<S, D>
Source§impl<S, D> Parse for Delimited<S, D>where
S: Parse,
D: DelimiterToken,
impl<S, D> Parse for Delimited<S, D>where
S: Parse,
D: DelimiterToken,
fn parse(input: &mut ParseStream) -> Result<Self, TokenParseError>
impl<S: PartialEq, D: PartialEq> StructuralPartialEq for Delimited<S, D>
Source§impl<S, D> ToCells for Delimited<S, D>where
S: ToCells,
impl<S, D> ToCells for Delimited<S, D>where
S: ToCells,
Source§fn to_cells(&self, output: &mut CellStream)
fn to_cells(&self, output: &mut CellStream)
Appends this value’s global cells to
output.Source§fn to_cell_stream(&self, source_id: SourceId) -> CellStream
fn to_cell_stream(&self, source_id: SourceId) -> CellStream
Emits this value into a fresh cell stream with the requested identity.
Auto Trait Implementations§
impl<S, D> Freeze for Delimited<S, D>
impl<S, D> RefUnwindSafe for Delimited<S, D>where
D: RefUnwindSafe,
S: RefUnwindSafe,
impl<S, D> Send for Delimited<S, D>
impl<S, D> Sync for Delimited<S, D>
impl<S, D> Unpin for Delimited<S, D>
impl<S, D> UnsafeUnpin for Delimited<S, D>where
D: UnsafeUnpin,
S: UnsafeUnpin,
impl<S, D> UnwindSafe for Delimited<S, D>where
D: UnwindSafe,
S: 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