pub struct TruncationOutcome<'a> {
pub text: Cow<'a, str>,
pub original_len: usize,
pub omitted: Option<Range<usize>>,
pub spill_ref: Option<SpillRef>,
}Expand description
Detailed outcome of a middle-out string truncation operation.
Preserves metadata including original length, omitted byte range, and
an optional SpillRef handle if an crate::OutputSpillSink was configured.
Fields§
§text: Cow<'a, str>The truncated or original text.
original_len: usizeByte length of the original input before truncation.
omitted: Option<Range<usize>>Byte range of the ORIGINAL input that was omitted.
None when untruncated.
spill_ref: Option<SpillRef>Pluggable spill reference handle if full output was retained by an crate::OutputSpillSink.
Implementations§
Source§impl<'a> TruncationOutcome<'a>
impl<'a> TruncationOutcome<'a>
Sourcepub const fn is_truncated(&self) -> bool
pub const fn is_truncated(&self) -> bool
Returns true if content was omitted during truncation.
Sourcepub const fn omitted_bytes(&self) -> usize
pub const fn omitted_bytes(&self) -> usize
Number of bytes omitted from the original input.
Trait Implementations§
Source§impl<'a> Clone for TruncationOutcome<'a>
impl<'a> Clone for TruncationOutcome<'a>
Source§impl<'a> Debug for TruncationOutcome<'a>
impl<'a> Debug for TruncationOutcome<'a>
impl<'a> Eq for TruncationOutcome<'a>
Source§impl<'a> PartialEq for TruncationOutcome<'a>
impl<'a> PartialEq for TruncationOutcome<'a>
impl<'a> StructuralPartialEq for TruncationOutcome<'a>
Auto Trait Implementations§
impl<'a> Freeze for TruncationOutcome<'a>
impl<'a> RefUnwindSafe for TruncationOutcome<'a>
impl<'a> Send for TruncationOutcome<'a>
impl<'a> Sync for TruncationOutcome<'a>
impl<'a> Unpin for TruncationOutcome<'a>
impl<'a> UnsafeUnpin for TruncationOutcome<'a>
impl<'a> UnwindSafe for TruncationOutcome<'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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.