Struct glsl_lang::ast::NodeSpan[][src]

pub struct NodeSpan {
    pub source_id: usize,
    pub start: usize,
    pub end: usize,
}

Span information for a node, constructed from a nom_locate::LocatedSpan

Fields

source_id: usize

The index of this span into the list of parsed units. This is used to identify which source string this span refers to when combining multiple ASTs

start: usize

Start of the node in the input slice

end: usize

End of the node in the input slice

Implementations

impl NodeSpan[src]

pub fn new_start(source_id: usize) -> NodeSpan[src]

Return a 0-length span located at the start of the given source

This may be used in span range queries.

pub fn new_end(source_id: usize, length: usize) -> NodeSpan[src]

Return a 0-length span located at the end of the given source (as indicated by the offset)

This may be used in span range queries.

pub fn to_end_location(&self) -> NodeSpan[src]

Return a 0-length span located at the end point of this span.

This may be used in span range queries. Note that the line and column information will not be accurate.

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

Return the length of this span

Trait Implementations

impl Clone for NodeSpan[src]

impl Copy for NodeSpan[src]

impl Debug for NodeSpan[src]

impl Eq for NodeSpan[src]

impl Hash for NodeSpan[src]

impl Ord for NodeSpan[src]

impl PartialEq<NodeSpan> for NodeSpan[src]

impl PartialOrd<NodeSpan> for NodeSpan[src]

impl StructuralEq for NodeSpan[src]

impl StructuralPartialEq for NodeSpan[src]

Auto Trait Implementations

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> IntoResult<T> for T[src]

type Err = Infallible

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.