pub struct Slice<'a> { /* private fields */ }
Expand description
A view on a region of the GapBuffer.
Slices will become invalidated if the gap is moved from the position they were created with
Implementations§
Source§impl<'a> Slice<'a>
impl<'a> Slice<'a>
Sourcepub fn from_byte(&self) -> usize
pub fn from_byte(&self) -> usize
The byte offset that this slice starts at within the parent GapBuffer.
Sourcepub fn len_utf8(&self) -> usize
pub fn len_utf8(&self) -> usize
The number of utf-8 characters within this slice.
Calculating involves parsing the entire slice as utf-8.
Sourcepub fn slice_iter(self) -> SliceIter<'a> ⓘ
pub fn slice_iter(self) -> SliceIter<'a> ⓘ
Iterate over the contiguous &u8 regions within this slice
Trait Implementations§
impl<'a> Copy for Slice<'a>
impl<'a> Eq for Slice<'a>
impl<'a> StructuralPartialEq for Slice<'a>
Auto Trait Implementations§
impl<'a> Freeze for Slice<'a>
impl<'a> RefUnwindSafe for Slice<'a>
impl<'a> Send for Slice<'a>
impl<'a> Sync for Slice<'a>
impl<'a> Unpin for Slice<'a>
impl<'a> UnwindSafe for Slice<'a>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.