pub struct Delimiter {
pub kind: DelimiterKind,
pub span: Span,
}Expand description
Type-erased delimiter data stored by a raw Group.
Fields§
§kind: DelimiterKind§span: SpanThe complete span of the delimited container.
Implementations§
Source§impl Delimiter
impl Delimiter
pub fn new(kind: DelimiterKind, span: Span) -> Self
Sourcepub fn opening_span(self) -> Span
pub fn opening_span(self) -> Span
Returns the opening delimiter span derived from the container span.
Sourcepub fn closing_span(self) -> Span
pub fn closing_span(self) -> Span
Returns the closing delimiter span derived from the container span.
Sourcepub fn surround(&self, output: &mut TokenStream, contents: TokenStream)
pub fn surround(&self, output: &mut TokenStream, contents: TokenStream)
Emits contents with this delimiter’s concrete token-tree shape.
Trait Implementations§
impl Copy for Delimiter
impl Eq for Delimiter
impl StructuralPartialEq for Delimiter
Auto Trait Implementations§
impl Freeze for Delimiter
impl RefUnwindSafe for Delimiter
impl Send for Delimiter
impl Sync for Delimiter
impl Unpin for Delimiter
impl UnsafeUnpin for Delimiter
impl UnwindSafe for Delimiter
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