pub struct TruncateConfigBuilder<S: State = Empty> { /* private fields */ }Expand description
Use builder syntax to set the inputs and finish with build().
Implementations§
Source§impl<S: State> TruncateConfigBuilder<S>
impl<S: State> TruncateConfigBuilder<S>
Sourcepub fn build(self) -> TruncateConfigwhere
S: IsComplete,
pub fn build(self) -> TruncateConfigwhere
S: IsComplete,
Finish building and return the requested object
Sourcepub fn preview_tokens(
self,
value: f64,
) -> TruncateConfigBuilder<SetPreviewTokens<S>>where
S::PreviewTokens: IsUnset,
pub fn preview_tokens(
self,
value: f64,
) -> TruncateConfigBuilder<SetPreviewTokens<S>>where
S::PreviewTokens: IsUnset,
Optional (Some / Option setters).
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.
Sourcepub fn maybe_preview_tokens(
self,
value: Option<f64>,
) -> TruncateConfigBuilder<SetPreviewTokens<S>>where
S::PreviewTokens: IsUnset,
pub fn maybe_preview_tokens(
self,
value: Option<f64>,
) -> TruncateConfigBuilder<SetPreviewTokens<S>>where
S::PreviewTokens: IsUnset,
Optional (Some / Option setters).
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.
Sourcepub fn preview(self, value: PreviewMode) -> TruncateConfigBuilder<SetPreview<S>>where
S::Preview: IsUnset,
pub fn preview(self, value: PreviewMode) -> TruncateConfigBuilder<SetPreview<S>>where
S::Preview: IsUnset,
Optional (Some / Option setters).
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.
Sourcepub fn maybe_preview(
self,
value: Option<PreviewMode>,
) -> TruncateConfigBuilder<SetPreview<S>>where
S::Preview: IsUnset,
pub fn maybe_preview(
self,
value: Option<PreviewMode>,
) -> TruncateConfigBuilder<SetPreview<S>>where
S::Preview: IsUnset,
Optional (Some / Option setters).
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.
Auto Trait Implementations§
impl<S> Freeze for TruncateConfigBuilder<S>
impl<S> RefUnwindSafe for TruncateConfigBuilder<S>
impl<S> Send for TruncateConfigBuilder<S>
impl<S> Sync for TruncateConfigBuilder<S>
impl<S> Unpin for TruncateConfigBuilder<S>
impl<S> UnsafeUnpin for TruncateConfigBuilder<S>
impl<S> UnwindSafe for TruncateConfigBuilder<S>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§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> ⓘ
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> ⓘ
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