pub struct ResponseMetadata {
pub truncated: Option<bool>,
pub original_size: Option<usize>,
pub final_size: Option<usize>,
pub item_count: Option<usize>,
pub total_items: Option<usize>,
pub compressed: Option<bool>,
pub retrieval_ref: Option<String>,
}Expand description
Metadata about a tool response
This provides additional context about the response, such as whether the output was truncated or the original size of the data.
Fields§
§truncated: Option<bool>Whether the output was truncated to fit size limits
original_size: Option<usize>Original size of the data before truncation (in bytes or count)
final_size: Option<usize>Final size after truncation
item_count: Option<usize>Number of items (for lists/arrays)
total_items: Option<usize>Total items before truncation
compressed: Option<bool>Whether data was compressed/stored for retrieval
retrieval_ref: Option<String>Reference ID for retrieving full data
Implementations§
Source§impl ResponseMetadata
impl ResponseMetadata
Sourcepub fn truncated(original_size: usize, final_size: usize) -> Self
pub fn truncated(original_size: usize, final_size: usize) -> Self
Create metadata for truncated output
Sourcepub fn for_list(item_count: usize, total_items: usize) -> Self
pub fn for_list(item_count: usize, total_items: usize) -> Self
Create metadata for a list with item counts
Sourcepub fn compressed(retrieval_ref: String, original_size: usize) -> Self
pub fn compressed(retrieval_ref: String, original_size: usize) -> Self
Create metadata for compressed output with retrieval reference
Sourcepub fn is_modified(&self) -> bool
pub fn is_modified(&self) -> bool
Check if this metadata indicates any modification (truncation/compression)
Trait Implementations§
Source§impl Clone for ResponseMetadata
impl Clone for ResponseMetadata
Source§fn clone(&self) -> ResponseMetadata
fn clone(&self) -> ResponseMetadata
Returns a duplicate of the value. Read more
1.0.0 · 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 ResponseMetadata
impl Debug for ResponseMetadata
Source§impl Default for ResponseMetadata
impl Default for ResponseMetadata
Source§fn default() -> ResponseMetadata
fn default() -> ResponseMetadata
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ResponseMetadata
impl<'de> Deserialize<'de> for ResponseMetadata
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ResponseMetadata
impl RefUnwindSafe for ResponseMetadata
impl Send for ResponseMetadata
impl Sync for ResponseMetadata
impl Unpin for ResponseMetadata
impl UnwindSafe for ResponseMetadata
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<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> 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 moreCreates a shared type from an unshared type.