pub struct TokenStream { /* private fields */ }
Implementations§
Trait Implementations§
Source§impl Clone for TokenStream
impl Clone for TokenStream
Source§fn clone(&self) -> TokenStream
fn clone(&self) -> TokenStream
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Compare<TokenStream> for TokenStream
impl Compare<TokenStream> for TokenStream
Source§fn compare(&self, t: TokenStream) -> CompareResult
fn compare(&self, t: TokenStream) -> CompareResult
Compares self to another value for equality
Source§fn compare_no_case(&self, t: TokenStream) -> CompareResult
fn compare_no_case(&self, t: TokenStream) -> CompareResult
Compares self to another value for equality
independently of the case. Read more
Source§impl Debug for TokenStream
impl Debug for TokenStream
Source§impl Default for TokenStream
impl Default for TokenStream
Source§fn default() -> TokenStream
fn default() -> TokenStream
Returns the “default value” for a type. Read more
Source§impl Input for TokenStream
impl Input for TokenStream
Source§type IterIndices = Enumerate<<TokenStream as Input>::Iter>
type IterIndices = Enumerate<<TokenStream as Input>::Iter>
An iterator over the input type, producing the item and its byte position
If we’re iterating over
&str
, the position
corresponds to the byte index of the characterSource§fn input_len(&self) -> usize
fn input_len(&self) -> usize
Calculates the input length, as indicated by its name,
and the name of the trait itself
Source§fn take_from(&self, index: usize) -> Self
fn take_from(&self, index: usize) -> Self
Returns a slice starting at
index
bytes. panics if index > lengthSource§fn take_split(&self, index: usize) -> (Self, Self)
fn take_split(&self, index: usize) -> (Self, Self)
Split the stream at the
index
byte offset. panics if index > lengthSource§fn position<P>(&self, predicate: P) -> Option<usize>
fn position<P>(&self, predicate: P) -> Option<usize>
Returns the byte position of the first element satisfying the predicate
Source§fn iter_elements(&self) -> Self::Iter
fn iter_elements(&self) -> Self::Iter
Returns an iterator over the elements
Source§fn iter_indices(&self) -> Self::IterIndices
fn iter_indices(&self) -> Self::IterIndices
Returns an iterator over the elements and their byte offsets
Source§fn slice_index(&self, count: usize) -> Result<usize, Needed>
fn slice_index(&self, count: usize) -> Result<usize, Needed>
Get the byte offset from the element’s position in the stream
Source§fn split_at_position<P, E>(&self, predicate: P) -> Result<(Self, Self), Err<E>>
fn split_at_position<P, E>(&self, predicate: P) -> Result<(Self, Self), Err<E>>
Looks for the first element of the input type for which the condition returns true,
and returns the input up to this position. Read more
Source§fn split_at_position1<P, E>(
&self,
predicate: P,
e: ErrorKind,
) -> Result<(Self, Self), Err<E>>
fn split_at_position1<P, E>( &self, predicate: P, e: ErrorKind, ) -> Result<(Self, Self), Err<E>>
Looks for the first element of the input type for which the condition returns true
and returns the input up to this position. Read more
Source§fn split_at_position_complete<P, E>(
&self,
predicate: P,
) -> Result<(Self, Self), Err<E>>
fn split_at_position_complete<P, E>( &self, predicate: P, ) -> Result<(Self, Self), Err<E>>
Looks for the first element of the input type for which the condition returns true,
and returns the input up to this position. Read more
Source§fn split_at_position1_complete<P, E>(
&self,
predicate: P,
e: ErrorKind,
) -> Result<(Self, Self), Err<E>>
fn split_at_position1_complete<P, E>( &self, predicate: P, e: ErrorKind, ) -> Result<(Self, Self), Err<E>>
Looks for the first element of the input type for which the condition returns true
and returns the input up to this position. Read more
Source§fn split_at_position_mode<OM, P, E>(
&self,
predicate: P,
) -> Result<(Self, <<OM as OutputMode>::Output as Mode>::Output<Self>), Err<E, <<OM as OutputMode>::Error as Mode>::Output<E>>>
fn split_at_position_mode<OM, P, E>( &self, predicate: P, ) -> Result<(Self, <<OM as OutputMode>::Output as Mode>::Output<Self>), Err<E, <<OM as OutputMode>::Error as Mode>::Output<E>>>
mode version of split_at_position
Source§fn split_at_position_mode1<OM, P, E>(
&self,
predicate: P,
e: ErrorKind,
) -> Result<(Self, <<OM as OutputMode>::Output as Mode>::Output<Self>), Err<E, <<OM as OutputMode>::Error as Mode>::Output<E>>>
fn split_at_position_mode1<OM, P, E>( &self, predicate: P, e: ErrorKind, ) -> Result<(Self, <<OM as OutputMode>::Output as Mode>::Output<Self>), Err<E, <<OM as OutputMode>::Error as Mode>::Output<E>>>
mode version of split_at_position
Auto Trait Implementations§
impl Freeze for TokenStream
impl RefUnwindSafe for TokenStream
impl Send for TokenStream
impl Sync for TokenStream
impl Unpin for TokenStream
impl UnwindSafe for TokenStream
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