Struct lsp_document::IndexedText
source · [−]Expand description
A combo of TextMap
+ TextAdapter
. Wraps the original text and
provides all the conversion methods.
Generic over the type of the text it wraps. Can be used with e.g. &str
,
String
, or Arc<str>
, depending on whether ownership is needed and if it
needs to be unique or shared.
Implementations
Trait Implementations
sourceimpl<T: Clone> Clone for IndexedText<T> where
T: Borrow<str>,
impl<T: Clone> Clone for IndexedText<T> where
T: Borrow<str>,
sourcefn clone(&self) -> IndexedText<T>
fn clone(&self) -> IndexedText<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<T: PartialEq> PartialEq<IndexedText<T>> for IndexedText<T> where
T: Borrow<str>,
impl<T: PartialEq> PartialEq<IndexedText<T>> for IndexedText<T> where
T: Borrow<str>,
sourcefn eq(&self, other: &IndexedText<T>) -> bool
fn eq(&self, other: &IndexedText<T>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &IndexedText<T>) -> bool
fn ne(&self, other: &IndexedText<T>) -> bool
This method tests for !=
.
sourceimpl<T: Borrow<str>> TextMap for IndexedText<T>
impl<T: Borrow<str>> TextMap for IndexedText<T>
impl<T: Eq> Eq for IndexedText<T> where
T: Borrow<str>,
impl<T> StructuralEq for IndexedText<T> where
T: Borrow<str>,
impl<T> StructuralPartialEq for IndexedText<T> where
T: Borrow<str>,
Auto Trait Implementations
impl<T> RefUnwindSafe for IndexedText<T> where
T: RefUnwindSafe,
impl<T> Send for IndexedText<T> where
T: Send,
impl<T> Sync for IndexedText<T> where
T: Sync,
impl<T> Unpin for IndexedText<T> where
T: Unpin,
impl<T> UnwindSafe for IndexedText<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> TextAdapter for T where
T: TextMap,
impl<T> TextAdapter for T where
T: TextMap,
fn pos_to_lsp_pos(&self, pos: &Pos) -> Option<Position>
fn lsp_pos_to_pos(&self, lsp_pos: &Position) -> Option<Pos>
fn range_to_lsp_range(&self, range: &Range<Pos>) -> Option<Range>
fn lsp_range_to_range(&self, lsp_range: &Range) -> Option<Range<Pos>>
fn change_to_lsp_change(
&self,
change: TextChange
) -> Option<TextDocumentContentChangeEvent>
fn lsp_change_to_change(
&self,
lsp_change: TextDocumentContentChangeEvent
) -> Option<TextChange>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more