pub struct ToolInvocationCost {
pub units: u64,
pub currency: String,
pub breakdown: Option<Value>,
}Expand description
Cost reported by a tool server after invocation.
Tool servers that track monetary costs override invoke_with_cost and
return this struct. Servers that do not override return None via the
default implementation, and the kernel charges max_cost_per_invocation
as a worst-case debit.
Fields§
§units: u64Cost in the currency’s smallest unit (e.g. cents for USD).
currency: StringISO 4217 currency code.
breakdown: Option<Value>Optional cost breakdown for audit.
Trait Implementations§
Source§impl Clone for ToolInvocationCost
impl Clone for ToolInvocationCost
Source§fn clone(&self) -> ToolInvocationCost
fn clone(&self) -> ToolInvocationCost
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 ToolInvocationCost
impl Debug for ToolInvocationCost
Source§impl<'de> Deserialize<'de> for ToolInvocationCost
impl<'de> Deserialize<'de> for ToolInvocationCost
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 ToolInvocationCost
impl RefUnwindSafe for ToolInvocationCost
impl Send for ToolInvocationCost
impl Sync for ToolInvocationCost
impl Unpin for ToolInvocationCost
impl UnsafeUnpin for ToolInvocationCost
impl UnwindSafe for ToolInvocationCost
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