pub struct Preview {
pub pipeline: Pipeline,
pub original: String,
pub compressed: String,
pub original_tokens: usize,
pub compressed_tokens: usize,
}Expand description
A computed preview: the original, the compressed form lean-ctx would emit, and the token/byte accounting for both.
Fields§
§pipeline: Pipeline§original: String§compressed: String§original_tokens: usize§compressed_tokens: usizeImplementations§
Source§impl Preview
impl Preview
pub fn original_bytes(&self) -> usize
pub fn compressed_bytes(&self) -> usize
Sourcepub fn saved_tokens(&self) -> usize
pub fn saved_tokens(&self) -> usize
Tokens removed. Saturating: a pipeline never inflates in practice, but the accounting stays honest (never negative) if a pathological input did.
Auto Trait Implementations§
impl Forget for Preview
impl Freeze for Preview
impl Move for Preview
impl RefUnwindSafe for Preview
impl Send for Previewwhere
RawVecInner: Send,
impl Sync for Previewwhere
RawVecInner: Sync,
impl Unpin for Preview
impl UnsafeUnpin for Preview
impl UnwindSafe for Previewwhere
RawVecInner: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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