[][src]Struct antlr_rust::token_factory::ArenaFactory

pub struct ArenaFactory<'input, TF, T> { /* fields omitted */ }

This is a wrapper for Token factory that allows to allocate tokens in separate arena. It can allow to significantly improve performance by passing Tokens by references everywhere.

Requires &'a Tok: Default bound to produce invalid tokens, which can be easily implemented like this:

lazy_static!{ static ref INVALID_TOKEN:Box<CustomToken> = ... }
impl Default for &'_ CustomToken {
    fn default() -> Self { &**INVALID_TOKEN }
}

or if possible just

const INVALID_TOKEN:CustomToken = ...

Trait Implementations

impl<'input, TF: Debug, T> Debug for ArenaFactory<'input, TF, T>[src]

impl<'input, TF, T> Default for ArenaFactory<'input, TF, T> where
    TF: Default
[src]

impl<'input, TF, T> TidAble<'input> for ArenaFactory<'input, TF, T> where
    TF: TidAble<'input>,
    T: TidAble<'input>, 
[src]

type Static = __ArenaFactoryinputTFT_should_never_exist<TF::Static, T::Static>

impl<'input, TF, Tok> TokenFactory<'input> for ArenaFactory<'input, TF, Tok> where
    TF: TokenFactory<'input, Tok = Box<Tok>, Inner = Tok>,
    Tok: Token<Data = TF::Data> + Clone + TidAble<'input>,
    &'a Tok: Default
[src]

type Inner = Tok

Type of tokens emitted by this factory.

type Tok = &'input Tok

Ownership of the emitted tokens

type Data = TF::Data

Type of the underlying storage

type From = TF::From

Type of the CharStream that factory can produce tokens from

Auto Trait Implementations

impl<'input, TF, T> !RefUnwindSafe for ArenaFactory<'input, TF, T>[src]

impl<'input, TF, T> Send for ArenaFactory<'input, TF, T> where
    T: Send,
    TF: Send
[src]

impl<'input, TF, T> !Sync for ArenaFactory<'input, TF, T>[src]

impl<'input, TF, T> Unpin for ArenaFactory<'input, TF, T> where
    T: Unpin,
    TF: Unpin
[src]

impl<'input, TF, T> UnwindSafe for ArenaFactory<'input, TF, T> where
    T: UnwindSafe,
    TF: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> NodeText for T[src]

impl<'a, T> Tid<'a> for T where
    T: TidAble<'a> + ?Sized
[src]

impl<'a, X> TidExt<'a> for X where
    X: Tid<'a> + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.