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

pub trait TokenCollection<'a> {
    type TPos: PartialOrd + Copy;
    type TToken: 'a;
    pub fn get_start_at_index(&self, index: usize) -> Self::TPos;
pub fn get_end_at_index(&self, index: usize) -> Self::TPos;
pub fn get_token_at_index(&self, index: usize) -> &'a Self::TToken;
pub fn len(&self) -> usize;
pub fn is_empty(&self) -> bool; }

Trait for a collection of tokens.

Associated Types

type TPos: PartialOrd + Copy[src]

The position type the token uses.

type TToken: 'a[src]

The token type.

Loading content...

Required methods

pub fn get_start_at_index(&self, index: usize) -> Self::TPos[src]

Gets the start position at the specified collection index.

pub fn get_end_at_index(&self, index: usize) -> Self::TPos[src]

Gets the end position at the specified collection index.

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

Gets the token at the specified collection index.

pub fn len(&self) -> usize[src]

Gets the length of the collection.

pub fn is_empty(&self) -> bool[src]

Gets if the collection is empty.

Loading content...

Implementors

Loading content...