pub struct InvocableResult {
pub output: InvocableOutput,
pub metadata: MetadataMap,
}Expand description
The result of executing an Invocable capability.
Returned by Invocable::invoke on success. The output field carries
the actual content while metadata can hold timing information, cache
headers, or any other sideband data the caller might need.
Fields§
§output: InvocableOutputThe content produced by the invocable.
metadata: MetadataMapArbitrary key-value metadata about the execution (e.g. latency, cache status).
Implementations§
Source§impl InvocableResult
impl InvocableResult
Sourcepub fn new(output: InvocableOutput) -> Self
pub fn new(output: InvocableOutput) -> Self
Builds an invocable result with empty metadata.
Sourcepub fn structured(value: Value) -> Self
pub fn structured(value: Value) -> Self
Builds a structured result.
Sourcepub fn with_metadata(self, metadata: MetadataMap) -> Self
pub fn with_metadata(self, metadata: MetadataMap) -> Self
Replaces the result metadata.
Trait Implementations§
Source§impl Clone for InvocableResult
impl Clone for InvocableResult
Source§fn clone(&self) -> InvocableResult
fn clone(&self) -> InvocableResult
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 InvocableResult
impl Debug for InvocableResult
Source§impl<'de> Deserialize<'de> for InvocableResult
impl<'de> Deserialize<'de> for InvocableResult
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
Source§impl PartialEq for InvocableResult
impl PartialEq for InvocableResult
Source§impl Serialize for InvocableResult
impl Serialize for InvocableResult
impl StructuralPartialEq for InvocableResult
Auto Trait Implementations§
impl Freeze for InvocableResult
impl RefUnwindSafe for InvocableResult
impl Send for InvocableResult
impl Sync for InvocableResult
impl Unpin for InvocableResult
impl UnsafeUnpin for InvocableResult
impl UnwindSafe for InvocableResult
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