Skip to main content

CellStream

Struct CellStream 

Source
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

Source

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.

Source

pub fn from_cells(cells: impl IntoIterator<Item = TokenStream>) -> Self

Creates a stream from token streams already known to be complete cells.

Source

pub fn cells(&self) -> &[TokenStream]

Borrows the independently parseable cells.

Source

pub fn iter( &self, ) -> impl DoubleEndedIterator<Item = &TokenStream> + ExactSizeIterator

Iterates over the independently parseable cells.

Source

pub fn len(&self) -> usize

Returns the number of cells.

Source

pub fn is_empty(&self) -> bool

Reports whether the stream contains no cells.

Source

pub fn into_token_stream(self) -> TokenStream

Flattens the cells back into one token stream.

Source

pub fn to_token_stream(&self) -> TokenStream

Flattens borrowed cells back into one token stream.

Trait Implementations§

Source§

impl Clone for CellStream

Source§

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)

Performs copy-assignment from source. Read more
Source§

impl Debug for CellStream

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CellStream

Source§

fn default() -> CellStream

Returns the “default value” for a type. Read more
Source§

impl Display for CellStream

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> FmtResult

Formats the value using the given formatter. Read more
Source§

impl Eq for CellStream

Source§

impl FromIterator<TokenStream> for CellStream

Source§

fn from_iter<T: IntoIterator<Item = TokenStream>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl IntoIterator for CellStream

Source§

type Item = TokenStream

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<TokenStream>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'syntax> IntoIterator for &'syntax CellStream

Source§

type Item = &'syntax TokenStream

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'syntax, TokenStream>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl PartialEq for CellStream

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<I> IntoStreamingIterator for I
where I: IntoIterator,

Source§

fn into_streaming_iter(self) -> Convert<Self::IntoIter>

Source§

fn into_streaming_iter_ref<'a, T>(self) -> ConvertRef<'a, Self::IntoIter, T>
where Self: IntoIterator<Item = &'a T>, T: ?Sized,

Turns an IntoIterator of references into a StreamingIterator. Read more
Source§

fn into_streaming_iter_mut<'a, T>(self) -> ConvertMut<'a, Self::IntoIter, T>
where Self: IntoIterator<Item = &'a mut T>, T: ?Sized,

Turns an IntoIterator of mutable references into a StreamingIteratorMut. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.