pub struct BoundedText {
pub text: String,
pub original_bytes: usize,
pub retained_bytes: usize,
pub truncated: bool,
}Expand description
A byte-bounded, char-boundary-safe view of a string, with exact accounting of what was kept and what was cut.
Fields§
§text: StringThe retained prefix — always valid UTF-8, at most the byte budget.
original_bytes: usizeByte length of the original input.
retained_bytes: usizeByte length of text (≤ budget, ≤ original_bytes).
truncated: boolWhether anything was cut (retained_bytes < original_bytes).
Implementations§
Trait Implementations§
Source§impl Clone for BoundedText
impl Clone for BoundedText
Source§impl Debug for BoundedText
impl Debug for BoundedText
impl Eq for BoundedText
Source§impl PartialEq for BoundedText
impl PartialEq for BoundedText
impl StructuralPartialEq for BoundedText
Auto Trait Implementations§
impl Freeze for BoundedText
impl RefUnwindSafe for BoundedText
impl Send for BoundedText
impl Sync for BoundedText
impl Unpin for BoundedText
impl UnsafeUnpin for BoundedText
impl UnwindSafe for BoundedText
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.