Skip to main content

ToolCallEntry

Struct ToolCallEntry 

Source
pub struct ToolCallEntry { /* private fields */ }
Expand description

A declaration plus its optional completed result.

Implementations§

Source§

impl ToolCallEntry

Source

pub fn call(&self) -> &ToolCallContext

Borrows the declaration and effective execution input.

Source

pub fn input_mut(&mut self) -> Option<&mut ToolCallPayload>

Mutably borrows the input while this call is still pending.

Source

pub fn attachments_mut(&mut self) -> Option<&mut CallAttachments>

Mutably borrows the call-scoped attachments while this call is still pending. Returns None once the entry has been resolved.

Source

pub fn attach<T: Any + Send + Sync>(&mut self, value: T) -> bool

Attaches a typed value to this call while it is still pending, replacing any previous attachment of the same type. Returns true when attached, or false (dropping value) if the entry is already resolved.

Source

pub fn result(&self) -> Option<(&BlockId, &ToolResultPayload)>

Borrows the result block ID and result payload when completed.

Source

pub fn output_mut(&mut self) -> Option<&mut ToolOutput>

Mutably borrows output when this call has a result.

Source

pub fn media_mut(&mut self) -> Option<&mut Vec<MediaRef>>

Mutably borrows result media when this call has a result.

Source

pub fn push_note(&mut self, note: TextPayload)

Adds a note to the pending call or completed result as appropriate.

Trait Implementations§

Source§

impl Debug for ToolCallEntry

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.