pub struct Handle {
pub id: HandleId,
pub kind: HandleKind,
pub residency: Residency,
pub tokens: u32,
pub source: Option<CompactString>,
}Expand description
One addressable resource the agent holds.
Fields§
§id: HandleId§kind: HandleKind§residency: Residency§tokens: u32Token cost of the resident form (used by the eviction planner).
source: Option<CompactString>Link back to the source object in working context — for HandleKind::ToolResult this is
the tool call_id, letting the renderer project a handle’s residency onto its message
(read-time projection) without mutating the stored message. None for handles with no
in-context anchor.
Implementations§
Source§impl Handle
impl Handle
pub fn resident(id: HandleId, kind: HandleKind, tokens: u32) -> Self
Sourcepub fn resident_for(
id: HandleId,
kind: HandleKind,
tokens: u32,
source: impl Into<CompactString>,
) -> Self
pub fn resident_for( id: HandleId, kind: HandleKind, tokens: u32, source: impl Into<CompactString>, ) -> Self
A resident handle anchored to a source object (e.g. a tool call_id).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Handle
impl<'de> Deserialize<'de> for Handle
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 Handle
impl RefUnwindSafe for Handle
impl Send for Handle
impl Sync for Handle
impl Unpin for Handle
impl UnsafeUnpin for Handle
impl UnwindSafe for Handle
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