[][src]Struct tweep::FullContext

pub struct FullContext { /* fields omitted */ }

A context that represents a span of twee code with a beginning, end, and contents, along with a file name and some helper functions

Implementations

impl FullContext[src]

pub fn from(file_name: Option<String>, contents: String) -> Self[src]

Creates a new context from the given file name and string

pub fn get_file_name(&self) -> &Option<String>[src]

Gets a reference to the optional file name

pub fn get_start_position(&self) -> &Position[src]

Gets a reference to the 1-indexed start position of this context

pub fn get_end_position(&self) -> &Position[src]

Gets a reference to the inclusive 1-indexed end position of this context

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

Gets the span of this context as line bytes within the contents

pub fn get_contents(&self) -> &str[src]

Gets a reference to the contents of this context

pub fn subcontext<T>(&self, range: T) -> Self where
    T: SubContextRange, 
[src]

Creates a subcontext out of the current context from the inclusive, 1-indexed start and end positions

Trait Implementations

impl Clone for FullContext[src]

impl Debug for FullContext[src]

impl Eq for FullContext[src]

impl From<FullContext> for PartialContext[src]

impl PartialEq<FullContext> for FullContext[src]

impl StructuralEq for FullContext[src]

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