pub struct TestRange {
pub id: u32,
pub len: u32,
pub is_activated: bool,
}
Expand description
This is a simple span object for testing.
Fields§
§id: u32
§len: u32
§is_activated: bool
Trait Implementations§
Source§impl ContentLength for TestRange
impl ContentLength for TestRange
Source§fn content_len(&self) -> usize
fn content_len(&self) -> usize
User specific content length. Used by content-tree for character counts.
fn content_len_at_offset(&self, offset: usize) -> usize
fn offset_len_at_content(&self, content: usize) -> usize
Source§impl MergableSpan for TestRange
impl MergableSpan for TestRange
Source§impl Searchable for TestRange
impl Searchable for TestRange
Source§impl SplitableSpanHelpers for TestRange
impl SplitableSpanHelpers for TestRange
Source§fn truncate_h(&mut self, at: usize) -> Self
fn truncate_h(&mut self, at: usize) -> Self
Split the entry, returning the part of the entry which was jettisoned. After truncating at
pos
, self.len() == pos
and the returned value contains the rest of the items. Read moreSource§fn truncate_keeping_right_h(&mut self, at: usize) -> Self
fn truncate_keeping_right_h(&mut self, at: usize) -> Self
The inverse of truncate. This method mutably truncates an item, keeping all content from
at..item.len() and returning the item range from 0..at.
fn split(self, at: usize) -> (Self, Self)
Source§impl Toggleable for TestRange
impl Toggleable for TestRange
fn is_activated(&self) -> bool
fn mark_activated(&mut self)
fn mark_deactivated(&mut self)
fn is_deactivated(&self) -> bool
impl Copy for TestRange
impl Eq for TestRange
impl StructuralPartialEq for TestRange
Auto Trait Implementations§
impl Freeze for TestRange
impl RefUnwindSafe for TestRange
impl Send for TestRange
impl Sync for TestRange
impl Unpin for TestRange
impl UnwindSafe for TestRange
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<T> SplitableSpan for Twhere
T: SplitableSpanCtx<Ctx = ()>,
impl<T> SplitableSpan for Twhere
T: SplitableSpanCtx<Ctx = ()>,
Source§fn truncate(&mut self, at: usize) -> Self
fn truncate(&mut self, at: usize) -> Self
Split the entry, returning the part of the entry which was jettisoned. After truncating at
pos
, self.len() == pos
and the returned value contains the rest of the items. Read moreSource§fn truncate_keeping_right(&mut self, at: usize) -> Self
fn truncate_keeping_right(&mut self, at: usize) -> Self
The inverse of truncate. This method mutably truncates an item, keeping all content from
at..item.len() and returning the item range from 0..at.
fn split_h(self, at: usize) -> (Self, Self)
Source§impl<T> SplitableSpanCtx for Twhere
T: SplitableSpanHelpers,
impl<T> SplitableSpanCtx for Twhere
T: SplitableSpanHelpers,
type Ctx = ()
Source§fn truncate_ctx(&mut self, at: usize, _ctx: &<T as SplitableSpanCtx>::Ctx) -> T
fn truncate_ctx(&mut self, at: usize, _ctx: &<T as SplitableSpanCtx>::Ctx) -> T
Split the entry, returning the part of the entry which was jettisoned. After truncating at
pos
, self.len() == pos
and the returned value contains the rest of the items. Read moreSource§fn truncate_keeping_right_ctx(&mut self, at: usize, ctx: &Self::Ctx) -> Self
fn truncate_keeping_right_ctx(&mut self, at: usize, ctx: &Self::Ctx) -> Self
The inverse of truncate. This method mutably truncates an item, keeping all content from
at..item.len() and returning the item range from 0..at.