pub struct CellStream { /* private fields */ }Expand description
A sequence of independently parseable Macaulay2 token streams.
Cell boundaries are expressed by the collection itself. The boundary after its final element is also the end-of-file boundary, so neither fact needs a virtual token in the contained streams.
Implementations§
Source§impl CellStream
impl CellStream
Sourcepub fn new(tokens: TokenStream) -> Result<Self, CellStreamError>
pub fn new(tokens: TokenStream) -> Result<Self, CellStreamError>
Partitions a complete raw token stream and inserts inferred adjacency.
§Errors
Returns CellStreamError when the final tokens require more input
before they can form an independently parseable cell.
Sourcepub fn from_cells(cells: impl IntoIterator<Item = TokenStream>) -> Self
pub fn from_cells(cells: impl IntoIterator<Item = TokenStream>) -> Self
Creates a stream from token streams already known to be complete cells.
Sourcepub fn cells(&self) -> &[TokenStream]
pub fn cells(&self) -> &[TokenStream]
Borrows the independently parseable cells.
Sourcepub fn iter(
&self,
) -> impl DoubleEndedIterator<Item = &TokenStream> + ExactSizeIterator
pub fn iter( &self, ) -> impl DoubleEndedIterator<Item = &TokenStream> + ExactSizeIterator
Iterates over the independently parseable cells.
Sourcepub fn into_token_stream(self) -> TokenStream
pub fn into_token_stream(self) -> TokenStream
Flattens the cells back into one token stream.
Sourcepub fn to_token_stream(&self) -> TokenStream
pub fn to_token_stream(&self) -> TokenStream
Flattens borrowed cells back into one token stream.
Trait Implementations§
Source§impl Clone for CellStream
impl Clone for CellStream
Source§fn clone(&self) -> CellStream
fn clone(&self) -> CellStream
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CellStream
impl Debug for CellStream
Source§impl Default for CellStream
impl Default for CellStream
Source§fn default() -> CellStream
fn default() -> CellStream
Returns the “default value” for a type. Read more
Source§impl Display for CellStream
impl Display for CellStream
impl Eq for CellStream
Source§impl FromIterator<TokenStream> for CellStream
impl FromIterator<TokenStream> for CellStream
Source§fn from_iter<T: IntoIterator<Item = TokenStream>>(iter: T) -> Self
fn from_iter<T: IntoIterator<Item = TokenStream>>(iter: T) -> Self
Creates a value from an iterator. Read more
Source§impl IntoIterator for CellStream
impl IntoIterator for CellStream
Source§impl<'syntax> IntoIterator for &'syntax CellStream
impl<'syntax> IntoIterator for &'syntax CellStream
Auto Trait Implementations§
impl Freeze for CellStream
impl RefUnwindSafe for CellStream
impl Send for CellStream
impl Sync for CellStream
impl Unpin for CellStream
impl UnsafeUnpin for CellStream
impl UnwindSafe for CellStream
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