Skip to main content

Spanned

Struct Spanned 

Source
pub struct Spanned<N, S> {
    pub node: N,
    pub span: S,
}

Fields§

§node: N§span: S

Implementations§

Source§

impl<N, S> Spanned<N, S>

Source

pub fn new(node: N, span: S) -> Self

Source§

impl<V, S, O> Spanned<Node<V, S, O>, S>

Source

pub fn from_leaf(leaf: Leaf<O>, span: S) -> Self

Source

pub fn from_internal(internal: Internal<V, S, O>, span: S) -> Self

Source

pub fn from_cst_and_output(cst: CST<V, S, O>, output: Option<O>) -> Self

Source

pub fn from_cst(cst: CST<V, S, O>) -> Self

Source

pub fn as_leaf(&self) -> Option<&Leaf<O>>

Source

pub fn as_internal(&self) -> Option<&Internal<V, S, O>>

Source

pub fn into_leaf(self) -> Option<Leaf<O>>

Source

pub fn into_internal(self) -> Option<Internal<V, S, O>>

Source

pub fn as_first(&self) -> Option<&First<AST<V, S, O>>>

Source

pub fn as_second(&self) -> Option<&Second<AST<V, S, O>>>

Source

pub fn into_first(self) -> Option<First<AST<V, S, O>>>

Source

pub fn into_second(self) -> Option<Second<AST<V, S, O>>>

Source

pub fn as_original(&self) -> Option<&O>

Source

pub fn as_metasymbol(&self) -> Option<&Metasymbol>

Source

pub fn into_original(self) -> Option<O>

Source

pub fn into_metasymbol(self) -> Option<Metasymbol>

Source§

impl<V, S, O> Spanned<Equivalence<V, Choice<Spanned<Node<V, S, O>, S>>>, S>

Source

pub fn as_first(&self) -> Option<&First<AST<V, S, O>>>

Source

pub fn as_second(&self) -> Option<&Second<AST<V, S, O>>>

Source

pub fn into_first(self) -> Option<First<AST<V, S, O>>>

Source

pub fn into_second(self) -> Option<Second<AST<V, S, O>>>

Source§

impl<O, V, S: Clone> Spanned<Equivalence<V, Choice<Spanned<Node<V, S, O>, S>>>, S>

Source

pub fn into_omit(self) -> Self

Trait Implementations§

Source§

impl<N: Clone, S: Clone> Clone for Spanned<N, S>

Source§

fn clone(&self) -> Spanned<N, S>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<N: Debug, S: Debug> Debug for Spanned<N, S>

Source§

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

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

impl<V, S, O> From<Spanned<Node<V, S, O>, S>> for Choice<AST<V, S, O>>

Source§

fn from(e: AST<V, S, O>) -> Self

Converts to this type from the input type.
Source§

impl<V, S, O> From<Spanned<Node<V, S, O>, S>> for Second<AST<V, S, O>>

Source§

fn from(e: AST<V, S, O>) -> Self

Converts to this type from the input type.
Source§

impl<N: PartialEq, S: PartialEq> PartialEq for Spanned<N, S>

Source§

fn eq(&self, other: &Spanned<N, S>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<N, S> StructuralPartialEq for Spanned<N, S>

Auto Trait Implementations§

§

impl<N, S> Freeze for Spanned<N, S>
where N: Freeze, S: Freeze,

§

impl<N, S> RefUnwindSafe for Spanned<N, S>

§

impl<N, S> Send for Spanned<N, S>
where N: Send, S: Send,

§

impl<N, S> Sync for Spanned<N, S>
where N: Sync, S: Sync,

§

impl<N, S> Unpin for Spanned<N, S>
where N: Unpin, S: Unpin,

§

impl<N, S> UnsafeUnpin for Spanned<N, S>
where N: UnsafeUnpin, S: UnsafeUnpin,

§

impl<N, S> UnwindSafe for Spanned<N, S>
where N: UnwindSafe, S: 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<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.