pub struct PlainText {
pub n: usize,
}Expand description
Default provider for non-segmented texts: lim_at(p) = n - p.
Stored as a single usize; the #[inline(always)] lim_at
folds at monomorphization time into the same n - p the merge
used before this abstraction existed, so non-segmented callers
pay zero overhead.
Fields§
§n: usizeTotal text length in symbols.
Implementations§
Trait Implementations§
Source§impl LimitProvider for PlainText
impl LimitProvider for PlainText
Source§fn lim_at(&self, p: usize) -> usize
fn lim_at(&self, p: usize) -> usize
Logical length of the suffix starting at position
p in
symbols — i.e. the number of comparable symbols before the
next segment boundary or end-of-text. Must be at most
text.len() - p.Source§fn boundary_order(
&self,
p_a: usize,
lim_a: usize,
p_b: usize,
lim_b: usize,
) -> Ordering
fn boundary_order( &self, p_a: usize, lim_a: usize, p_b: usize, lim_b: usize, ) -> Ordering
Order to resolve when one or both suffixes hit their boundary
before any byte of their shared prefix differs. The default
is
lim_a.cmp(&lim_b) — “shorter-suffix-is-smaller”, the
standard generalised-SA / multi-string-SA convention, what a
Vec<&str> sort with &str ordering produces. Read moreimpl Copy for PlainText
Auto Trait Implementations§
impl Freeze for PlainText
impl RefUnwindSafe for PlainText
impl Send for PlainText
impl Sync for PlainText
impl Unpin for PlainText
impl UnsafeUnpin for PlainText
impl UnwindSafe for PlainText
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more