Struct rslint_regex::Span[][src]

pub struct Span {
    pub offset: usize,
    pub start: usize,
    pub end: usize,
}

Fields

offset: usize

The offset in the whole file to calculate the absolute position.

start: usize

The relative start of this Span inside a pattern.

end: usize

The relative end of this Span inside a pattern.

Implementations

impl Span[src]

pub fn new(offset: usize, start: usize, end: usize) -> Self[src]

Create a new Span

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

Calculates the absolute start using self.offset + self.start.

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

Calculates the absolute end using self.offset + self.end.

pub fn as_range(&self) -> Range<usize>[src]

Trait Implementations

impl Clone for Span[src]

impl Debug for Span[src]

impl Eq for Span[src]

impl From<Range<usize>> for Span[src]

impl Hash for Span[src]

impl PartialEq<Span> for Span[src]

impl StructuralEq for Span[src]

impl StructuralPartialEq for Span[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> 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.