pub struct TruncationReport {
pub payload_chars_before: usize,
pub payload_chars_after: usize,
pub messages_truncated: usize,
}Expand description
Summary of what truncate_history did to a request body.
Callers record observability metrics from this rather than re-computing the
same values. Default — every field zero — is the report for a request
that was never measured at all, which is what a caller with no budget gets.
Fields§
§payload_chars_before: usizeSerialized payload size in bytes before truncation.
payload_chars_after: usizeSerialized payload size in bytes after truncation. Equal to
payload_chars_before when nothing was changed.
messages_truncated: usizeNumber of messages whose content was replaced with
TRUNCATION_PLACEHOLDER.
Implementations§
Trait Implementations§
Source§impl Clone for TruncationReport
impl Clone for TruncationReport
Source§fn clone(&self) -> TruncationReport
fn clone(&self) -> TruncationReport
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TruncationReport
impl Debug for TruncationReport
Source§impl Default for TruncationReport
impl Default for TruncationReport
Source§fn default() -> TruncationReport
fn default() -> TruncationReport
Returns the “default value” for a type. Read more
Source§impl PartialEq for TruncationReport
impl PartialEq for TruncationReport
Source§fn eq(&self, other: &TruncationReport) -> bool
fn eq(&self, other: &TruncationReport) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for TruncationReport
impl StructuralPartialEq for TruncationReport
Auto Trait Implementations§
impl Freeze for TruncationReport
impl RefUnwindSafe for TruncationReport
impl Send for TruncationReport
impl Sync for TruncationReport
impl Unpin for TruncationReport
impl UnsafeUnpin for TruncationReport
impl UnwindSafe for TruncationReport
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