pub struct CellBlock { /* private fields */ }Expand description
One top-level token sequence together with its terminating delimiter.
An ordinary cell has DelimiterKind::Empty. A muted cell has
DelimiterKind::Semicolon, and its semicolon is held by the delimiter
rather than repeated in stream.
Implementations§
Source§impl CellBlock
impl CellBlock
Sourcepub fn new(delimiter: Delimiter, stream: TokenStream) -> Self
pub fn new(delimiter: Delimiter, stream: TokenStream) -> Self
Creates a cell from its delimiter and interior token stream.
Sourcepub fn delimiter(&self) -> &Delimiter
pub fn delimiter(&self) -> &Delimiter
Returns the type-erased cell delimiter and its boundary spans.
Sourcepub fn delim_kind(&self) -> DelimiterKind
pub fn delim_kind(&self) -> DelimiterKind
Returns whether this is an ordinary or semicolon-terminated cell.
Sourcepub fn stream(&self) -> &TokenStream
pub fn stream(&self) -> &TokenStream
Borrows the tokens inside the cell delimiter.
Sourcepub fn into_stream(self) -> TokenStream
pub fn into_stream(self) -> TokenStream
Consumes the cell and returns the tokens inside its delimiter.
Trait Implementations§
impl Eq for CellBlock
Source§impl Extend<CellBlock> for CellStream
impl Extend<CellBlock> for CellStream
Source§fn extend<T: IntoIterator<Item = CellBlock>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = CellBlock>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
impl StructuralPartialEq for CellBlock
Source§impl ToCells for CellBlock
impl ToCells for CellBlock
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 Freeze for CellBlock
impl RefUnwindSafe for CellBlock
impl Send for CellBlock
impl Sync for CellBlock
impl Unpin for CellBlock
impl UnsafeUnpin for CellBlock
impl UnwindSafe for CellBlock
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