pub struct TruncateConfig {
pub preview_tokens: Option<f64>,
pub preview: Option<PreviewMode>,
}Expand description
Configuration of the truncate method (TruncateConfig).
Fields§
§preview_tokens: Option<f64>Tokens of text to keep as the preview. Defaults to 1,000. Content that already fits is left
unchanged. For a whole-message truncate, the budget of whole messages kept at the head and
tail; the rest are replaced by one [... earlier messages elided, ~N tokens ...] marker.
preview: Option<PreviewMode>Which part of the text to keep. Defaults to PreviewMode::HeadTail. For a whole-message
truncate, PreviewMode::Head keeps only the oldest messages and PreviewMode::Tail only
the newest.
Implementations§
Source§impl TruncateConfig
impl TruncateConfig
Sourcepub fn builder() -> TruncateConfigBuilder
pub fn builder() -> TruncateConfigBuilder
Create an instance of TruncateConfig using the builder syntax
Trait Implementations§
Source§impl Clone for TruncateConfig
impl Clone for TruncateConfig
Source§impl Debug for TruncateConfig
impl Debug for TruncateConfig
Source§impl Default for TruncateConfig
impl Default for TruncateConfig
Source§impl PartialEq for TruncateConfig
impl PartialEq for TruncateConfig
impl StructuralPartialEq for TruncateConfig
Auto Trait Implementations§
impl Freeze for TruncateConfig
impl RefUnwindSafe for TruncateConfig
impl Send for TruncateConfig
impl Sync for TruncateConfig
impl Unpin for TruncateConfig
impl UnsafeUnpin for TruncateConfig
impl UnwindSafe for TruncateConfig
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 moreCreates a shared type from an unshared type.