pub struct CachedResultEnvelope {
pub handle: CachedResultHandle,
pub total_items: usize,
pub page_size: usize,
pub first_page: Vec<Value>,
pub truncated: bool,
pub omitted_items: usize,
pub page_token: Option<String>,
}Expand description
JSON envelope returned to the model in place of an oversized array.
The model sees first_page directly and can request later pages by
calling a host-supplied page tool with handle and an offset. The
envelope is deliberately small and self-describing so the model can
reason about how much data is hidden behind the handle. The truncation
fields mirror rig_compose::ToolResultEnvelope semantics for MCP result
caches: the cache does not discard data, but the model-visible page is
bounded and carries enough metadata for a follow-up page request.
Fields§
§handle: CachedResultHandleOpaque handle for the full cached result.
total_items: usizeTotal number of items the cache holds for this handle.
page_size: usizePage size the cache will use when serving subsequent pages.
first_page: Vec<Value>First page_size.min(total_items) items, inlined so the model
doesn’t always have to do a follow-up call.
truncated: boolWhether the model-visible page omitted cached items.
omitted_items: usizeNumber of cached items omitted from first_page.
page_token: Option<String>Stable follow-up token for the first omitted page.
Implementations§
Source§impl CachedResultEnvelope
impl CachedResultEnvelope
Sourcepub fn page_token(handle: &CachedResultHandle, offset: usize) -> String
pub fn page_token(handle: &CachedResultHandle, offset: usize) -> String
Build the follow-up page token for handle and the next offset.
Trait Implementations§
Source§impl Clone for CachedResultEnvelope
impl Clone for CachedResultEnvelope
Source§fn clone(&self) -> CachedResultEnvelope
fn clone(&self) -> CachedResultEnvelope
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CachedResultEnvelope
impl Debug for CachedResultEnvelope
Source§impl<'de> Deserialize<'de> for CachedResultEnvelope
impl<'de> Deserialize<'de> for CachedResultEnvelope
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>,
Source§impl PartialEq for CachedResultEnvelope
impl PartialEq for CachedResultEnvelope
Source§fn eq(&self, other: &CachedResultEnvelope) -> bool
fn eq(&self, other: &CachedResultEnvelope) -> bool
self and other values to be equal, and is used by ==.