Struct glsl_lang::ast::NodeSpan [−][src]
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]
pub fn hash<__H>(&self, state: &mut __H) where
__H: Hasher,
[src]
__H: Hasher,
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for NodeSpan
[src]
pub fn cmp(&self, other: &NodeSpan) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<NodeSpan> for NodeSpan
[src]
impl PartialOrd<NodeSpan> for NodeSpan
[src]
pub fn partial_cmp(&self, other: &NodeSpan) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for NodeSpan
[src]
impl StructuralPartialEq for NodeSpan
[src]
Auto Trait Implementations
impl RefUnwindSafe for NodeSpan
impl Send for NodeSpan
impl Sync for NodeSpan
impl Unpin for NodeSpan
impl UnwindSafe for NodeSpan
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoResult<T> for T
[src]
type Err = Infallible
pub fn into_result(self) -> Result<T, <T as IntoResult<T>>::Err>
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,