Trait dprint_core::formatting::tokens::TokenCollection
source · pub trait TokenCollection<'a> {
type TPos: PartialOrd + Copy;
type TToken: 'a;
// Required methods
fn get_start_at_index(&self, index: usize) -> Self::TPos;
fn get_end_at_index(&self, index: usize) -> Self::TPos;
fn get_token_at_index(&self, index: usize) -> &'a Self::TToken;
fn len(&self) -> usize;
fn is_empty(&self) -> bool;
}
Expand description
Trait for a collection of tokens.
Required Associated Types§
sourcetype TPos: PartialOrd + Copy
type TPos: PartialOrd + Copy
The position type the token uses.
Required Methods§
sourcefn get_start_at_index(&self, index: usize) -> Self::TPos
fn get_start_at_index(&self, index: usize) -> Self::TPos
Gets the start position at the specified collection index.
sourcefn get_end_at_index(&self, index: usize) -> Self::TPos
fn get_end_at_index(&self, index: usize) -> Self::TPos
Gets the end position at the specified collection index.
sourcefn get_token_at_index(&self, index: usize) -> &'a Self::TToken
fn get_token_at_index(&self, index: usize) -> &'a Self::TToken
Gets the token at the specified collection index.
Object Safety§
This trait is not object safe.