pub struct LineStartsCache { /* private fields */ }Implementations§
Source§impl LineStartsCache
impl LineStartsCache
pub fn new(text: &str) -> Self
pub fn new_rope(rope: &Rope) -> Self
pub fn offset_to_position(&self, text: &str, offset: usize) -> (u32, u32)
pub fn position_to_offset(&self, text: &str, line: u32, character: u32) -> usize
pub fn offset_to_position_rope(&self, rope: &Rope, offset: usize) -> (u32, u32)
pub fn position_to_offset_rope( &self, rope: &Rope, line: u32, character: u32, ) -> usize
Trait Implementations§
Source§impl Clone for LineStartsCache
impl Clone for LineStartsCache
Source§fn clone(&self) -> LineStartsCache
fn clone(&self) -> LineStartsCache
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 LineStartsCache
impl RefUnwindSafe for LineStartsCache
impl Send for LineStartsCache
impl Sync for LineStartsCache
impl Unpin for LineStartsCache
impl UnsafeUnpin for LineStartsCache
impl UnwindSafe for LineStartsCache
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