Struct TestRange

Source
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 Clone for TestRange

Source§

fn clone(&self) -> TestRange

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl ContentLength for TestRange

Source§

fn content_len(&self) -> usize

User specific content length. Used by content-tree for character counts.
Source§

fn content_len_at_offset(&self, offset: usize) -> usize

Source§

fn offset_len_at_content(&self, content: usize) -> usize

Source§

impl Debug for TestRange

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for TestRange

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl HasLength for TestRange

Source§

fn len(&self) -> usize

The number of child items in the entry. This is indexed with the size used in truncate.
Source§

fn is_empty(&self) -> bool

Source§

impl MergableSpan for TestRange

Source§

fn can_append(&self, other: &Self) -> bool

See if the other item can be appended to self. can_append will always be called immediately before append.
Source§

fn append(&mut self, other: Self)

Merge the passed item into self. Essentially, self = self + other. Read more
Source§

fn prepend(&mut self, other: Self)

Append an item at the start of this item. self = other + self. Read more
Source§

impl PartialEq for TestRange

Source§

fn eq(&self, other: &TestRange) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Searchable for TestRange

Source§

type Item = (u32, bool)

Source§

fn get_offset(&self, loc: Self::Item) -> Option<usize>

Checks if the entry contains the specified item. If it does, returns the offset into the item.
Source§

fn at_offset(&self, offset: usize) -> Self::Item

Source§

impl SplitableSpanHelpers for TestRange

Source§

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 more
Source§

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.
Source§

fn split(self, at: usize) -> (Self, Self)

Source§

impl Toggleable for TestRange

Source§

impl Copy for TestRange

Source§

impl Eq for TestRange

Source§

impl StructuralPartialEq for TestRange

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> SplitableSpan for T
where T: SplitableSpanCtx<Ctx = ()>,

Source§

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 more
Source§

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.
Source§

fn split_h(self, at: usize) -> (Self, Self)

Source§

impl<T> SplitableSpanCtx for T

Source§

type Ctx = ()

Source§

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 more
Source§

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.
Source§

fn split_ctx(self, at: usize, ctx: &Self::Ctx) -> (Self, Self)

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> Trim for T

Source§

fn trim(&mut self, at: usize) -> Option<Self>

Source§

impl<T> TrimCtx for T

Source§

fn trim_ctx(&mut self, at: usize, ctx: &Self::Ctx) -> Option<Self>

Trim self to at most at items. Remainder (if any) is returned.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ContentTraits for T

Source§

impl<T> SplitAndJoinSpan for T

Source§

impl<T> SplitAndJoinSpanCtx for T