pub struct VersionedSource {
pub uri: String,
pub version: i32,
pub content: String,
}Expand description
Source version tracking for LSP
Fields§
§uri: String§version: i32§content: StringImplementations§
Source§impl VersionedSource
impl VersionedSource
pub fn new(uri: impl Into<String>, content: impl Into<String>) -> Self
pub fn apply_change(&mut self, change: TextChange) -> &mut Self
pub fn update( &mut self, new_content: impl Into<String>, new_version: i32, ) -> &mut Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn offset_to_position(&self, offset: usize) -> (usize, usize)
pub fn position_to_offset(&self, line: usize, col: usize) -> Option<usize>
Trait Implementations§
Source§impl Clone for VersionedSource
impl Clone for VersionedSource
Source§fn clone(&self) -> VersionedSource
fn clone(&self) -> VersionedSource
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for VersionedSource
impl RefUnwindSafe for VersionedSource
impl Send for VersionedSource
impl Sync for VersionedSource
impl Unpin for VersionedSource
impl UnsafeUnpin for VersionedSource
impl UnwindSafe for VersionedSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more