[][src]Trait dprint_core::tokens::TokenCollection

pub trait TokenCollection<'a> {
    type TPos: PartialOrd + Copy;
    type TToken: 'a;
    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; }

Trait for a collection of tokens.

Associated Types

type TPos: PartialOrd + Copy

The position type the token uses.

type TToken: 'a

The token type.

Loading content...

Required methods

fn get_start_at_index(&self, index: usize) -> Self::TPos

Gets the start position at the specified collection index.

fn get_end_at_index(&self, index: usize) -> Self::TPos

Gets the end position at the specified collection index.

fn get_token_at_index(&self, index: usize) -> &'a Self::TToken

Gets the token at the specified collection index.

fn len(&self) -> usize

Gets the length of the collection.

fn is_empty(&self) -> bool

Gets if the collection is empty.

Loading content...

Implementors

Loading content...