Struct antlr_rust::token_factory::OwningTokenFactory
source · [−]pub struct OwningTokenFactory;
Expand description
Token factory that produces heap allocated
OwningToken
s
Trait Implementations
sourceimpl Debug for OwningTokenFactory
impl Debug for OwningTokenFactory
sourceimpl Default for OwningTokenFactory
impl Default for OwningTokenFactory
sourcefn default() -> OwningTokenFactory
fn default() -> OwningTokenFactory
Returns the “default value” for a type. Read more
sourceimpl<'a> TokenFactory<'a> for OwningTokenFactory
impl<'a> TokenFactory<'a> for OwningTokenFactory
type Inner = GenericToken<String>
type Inner = GenericToken<String>
Type of tokens emitted by this factory.
type Tok = Box<<OwningTokenFactory as TokenFactory<'a>>::Inner, Global>
type Tok = Box<<OwningTokenFactory as TokenFactory<'a>>::Inner, Global>
Ownership of the emitted tokens
sourcefn create<T>(
&'a self,
source: Option<&mut T>,
ttype: isize,
text: Option<String>,
channel: isize,
start: isize,
stop: isize,
line: isize,
column: isize
) -> Self::Tok where
T: CharStream<String> + ?Sized,
fn create<T>(
&'a self,
source: Option<&mut T>,
ttype: isize,
text: Option<String>,
channel: isize,
start: isize,
stop: isize,
line: isize,
column: isize
) -> Self::Tok where
T: CharStream<String> + ?Sized,
Creates token either from sourse
or from pure data in text
Either source
or text
are not None Read more
sourcefn create_invalid() -> Self::Tok
fn create_invalid() -> Self::Tok
Creates invalid token
Invalid tokens must have TOKEN_INVALID_TYPE
token type. Read more
impl<'a> TidAble<'a> for OwningTokenFactory
Auto Trait Implementations
impl RefUnwindSafe for OwningTokenFactory
impl Send for OwningTokenFactory
impl Sync for OwningTokenFactory
impl Unpin for OwningTokenFactory
impl UnwindSafe for OwningTokenFactory
Blanket Implementations
sourceimpl<T> AnyExt for T where
T: Any + ?Sized,
impl<T> AnyExt for T where
T: Any + ?Sized,
sourcefn downcast_ref<T>(this: &Self) -> Option<&T> where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T> where
T: Any,
Attempts to downcast this to T
behind reference
sourcefn downcast_mut<T>(this: &mut Self) -> Option<&mut T> where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T> where
T: Any,
Attempts to downcast this to T
behind mutable reference
sourcefn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>> where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>> where
T: Any,
Attempts to downcast this to T
behind Rc
pointer
sourcefn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>> where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>> where
T: Any,
Attempts to downcast this to T
behind Arc
pointer
sourcefn downcast_box<T>(
this: Box<Self, Global>
) -> Result<Box<T, Global>, Box<Self, Global>> where
T: Any,
fn downcast_box<T>(
this: Box<Self, Global>
) -> Result<Box<T, Global>, Box<Self, Global>> where
T: Any,
Attempts to downcast this to T
behind Box
pointer
sourcefn downcast_move<T>(this: Self) -> Option<T> where
T: Any,
fn downcast_move<T>(this: Self) -> Option<T> where
T: Any,
Attempts to downcast owned Self
to T
,
useful only in generic context as a workaround for specialization Read more
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T, X> CoerceTo<T> for X where
T: CoerceFrom<X> + ?Sized,
impl<T, X> CoerceTo<T> for X where
T: CoerceFrom<X> + ?Sized,
fn coerce_rc_to(self: Rc<X>) -> Rc<T>
fn coerce_box_to(self: Box<X, Global>) -> Box<T, Global>ⓘNotable traits for Box<W, Global>impl<W> Write for Box<W, Global> where
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
W: Write + ?Sized, impl<R> Read for Box<R, Global> where
R: Read + ?Sized, impl<I, A> Iterator for Box<I, A> where
I: Iterator + ?Sized,
A: Allocator, type Item = <I as Iterator>::Item;impl<F, A> Future for Box<F, A> where
F: Future + Unpin + ?Sized,
A: Allocator + 'static, type Output = <F as Future>::Output;
fn coerce_ref_to(&self) -> &T
fn coerce_mut_to(&mut self) -> &mut T
sourceimpl<'a, X> TidExt<'a> for X where
X: Tid<'a> + ?Sized,
impl<'a, X> TidExt<'a> for X where
X: Tid<'a> + ?Sized,
sourcefn is<T>(&self) -> bool where
T: Tid<'a>,
fn is<T>(&self) -> bool where
T: Tid<'a>,
Returns true if type behind self is equal to the type of T.
sourcefn downcast_ref<T>(&'b self) -> Option<&'b T> where
T: Tid<'a>,
fn downcast_ref<T>(&'b self) -> Option<&'b T> where
T: Tid<'a>,
Attempts to downcast self to T
behind reference
sourcefn downcast_mut<T>(&'b mut self) -> Option<&'b mut T> where
T: Tid<'a>,
fn downcast_mut<T>(&'b mut self) -> Option<&'b mut T> where
T: Tid<'a>,
Attempts to downcast self to T
behind mutable reference
sourcefn downcast_rc<T>(self: Rc<Self>) -> Result<Rc<T>, Rc<Self>> where
T: Tid<'a>,
fn downcast_rc<T>(self: Rc<Self>) -> Result<Rc<T>, Rc<Self>> where
T: Tid<'a>,
Attempts to downcast self to T
behind Rc
pointer
sourcefn downcast_arc<T>(self: Arc<Self>) -> Result<Arc<T>, Arc<Self>> where
T: Tid<'a>,
fn downcast_arc<T>(self: Arc<Self>) -> Result<Arc<T>, Arc<Self>> where
T: Tid<'a>,
Attempts to downcast self to T
behind Arc
pointer
sourcefn downcast_box<T>(
self: Box<Self, Global>
) -> Result<Box<T, Global>, Box<Self, Global>> where
T: Tid<'a>,
fn downcast_box<T>(
self: Box<Self, Global>
) -> Result<Box<T, Global>, Box<Self, Global>> where
T: Tid<'a>,
Attempts to downcast self to T
behind Box
pointer
sourcefn downcast_move<T>(self) -> Option<T> where
T: Tid<'a>,
fn downcast_move<T>(self) -> Option<T> where
T: Tid<'a>,
Attempts to downcast owned Self
to T
,
useful only in generic context as a workaround for specialization Read more