Struct Isolate

Source
pub struct Isolate<Type> {
    pub token: Type,
}
Expand description

Use Token to wrap any Type::Lexer to try to consume all WhiteSpaces before and after the given Lexer

WARNING: This should generally be used only when trying to group base tokens together. If we wanted to put together [, TOKEN and ] for example, we would want to wrap each of the parenthesis with Isolate to ensure that [ TOKEN ] is validly evaluated as well. However there is no need to wrap TOKEN itself.

Fields§

§token: Type

Trait Implementations§

Source§

impl<Type> AsMut<Type> for Isolate<Type>

Source§

fn as_mut(&mut self) -> &mut Type

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl<Type> AsRef<Type> for Isolate<Type>

Source§

fn as_ref(&self) -> &Type

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<Type: Clone> Clone for Isolate<Type>

Source§

fn clone(&self) -> Isolate<Type>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Type: Debug> Debug for Isolate<Type>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<Type> Deref for Isolate<Type>

Source§

type Target = Type

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<Type> DerefMut for Isolate<Type>

Source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
Source§

impl<Type: Display> Display for Isolate<Type>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'code, Type: Lexer<'code>> Lexer<'code> for Isolate<Type>

Source§

fn lex(buffer: &mut Buffer<'code>) -> Result<Self, Error<'code>>

Actual method that is used to lex a Buffer Read more
Source§

impl<'code, Type: Token<'code>> Token<'code> for Isolate<Type>

Source§

const NAME: &'static str = Type::NAME

Name of the token
Source§

fn buffer(&self) -> Option<Buffer<'code>>

Underlying Buffer on the Token. This is an Option because certain types of structures, e.g. std::marker::PhantomData do not actually store a Buffer and it is therefore theoretically possible that a Token has no inherent Buffer. Examples include Not and Peek

Auto Trait Implementations§

§

impl<Type> Freeze for Isolate<Type>
where Type: Freeze,

§

impl<Type> RefUnwindSafe for Isolate<Type>
where Type: RefUnwindSafe,

§

impl<Type> Send for Isolate<Type>
where Type: Send,

§

impl<Type> Sync for Isolate<Type>
where Type: Sync,

§

impl<Type> Unpin for Isolate<Type>
where Type: Unpin,

§

impl<Type> UnwindSafe for Isolate<Type>
where Type: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.