Struct arret_lsp_server::model::document::Document[][src]

pub struct Document {
    version: i32,
    text: String,
    line_offsets: Vec<usize>,
}

Fields

version: i32text: Stringline_offsets: Vec<usize>

Implementations

impl Document[src]

pub fn new(version: i32, text: String) -> Document[src]

pub fn with_range_edit(
    &self,
    new_version: i32,
    range: Range,
    new_range_text: &str
) -> Result<Document, ()>
[src]

Returns a new instance of the document with specified range replaced

pub fn version(&self) -> i32[src]

Returns the document version

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

Returns the document text

pub fn span_to_range(&self, span: Span) -> Range[src]

Returns an LSP Range for the given arret-syntax Span

pub fn offset_to_position(&self, offset: usize) -> Position[src]

Returns the position for the given byte offset

fn position_to_offset(&self, position: Position) -> Option<usize>[src]

Returns the byte offset for the given position

Trait Implementations

impl Debug for Document[src]

Auto Trait Implementations

impl RefUnwindSafe for Document

impl Send for Document

impl Sync for Document

impl Unpin for Document

impl UnwindSafe for Document

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, 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.