pub struct A2aTask { /* private fields */ }Expand description
A bounded A2A task projection.
Implementations§
Source§impl A2aTask
impl A2aTask
Sourcepub fn new(
id: impl Into<String>,
context_id: impl Into<String>,
status: A2aTaskStatus,
) -> Result<Self, A2aContractError>
pub fn new( id: impl Into<String>, context_id: impl Into<String>, status: A2aTaskStatus, ) -> Result<Self, A2aContractError>
Constructs a task projection. The identifier is an A2A identifier and
must not be an exposed StateKnot run identifier.
Sourcepub fn with_artifacts(
self,
artifacts: Vec<A2aArtifact>,
) -> Result<Self, A2aContractError>
pub fn with_artifacts( self, artifacts: Vec<A2aArtifact>, ) -> Result<Self, A2aContractError>
Adds a bounded artifact projection.
Sourcepub fn with_history(
self,
history: Vec<A2aMessage>,
) -> Result<Self, A2aContractError>
pub fn with_history( self, history: Vec<A2aMessage>, ) -> Result<Self, A2aContractError>
Adds bounded message history in chronological order.
Sourcepub fn with_metadata(
self,
metadata: HashMap<String, Value>,
) -> Result<Self, A2aContractError>
pub fn with_metadata( self, metadata: HashMap<String, Value>, ) -> Result<Self, A2aContractError>
Adds bounded task metadata.
Sourcepub fn context_id(&self) -> &str
pub fn context_id(&self) -> &str
Returns the opaque A2A context identifier.
Sourcepub fn state(&self) -> A2aTaskState
pub fn state(&self) -> A2aTaskState
Returns the task state.
Sourcepub fn status(&self) -> A2aTaskStatus
pub fn status(&self) -> A2aTaskStatus
Clones the status projection.
Sourcepub fn history(&self) -> Vec<A2aMessage>
pub fn history(&self) -> Vec<A2aMessage>
Clones message history for application mapping.
Sourcepub fn artifacts(&self) -> Vec<A2aArtifact>
pub fn artifacts(&self) -> Vec<A2aArtifact>
Clones artifact projections for application mapping.
Trait Implementations§
impl StructuralPartialEq for A2aTask
Auto Trait Implementations§
impl Forget for A2aTask
impl Freeze for A2aTask
impl Move for A2aTask
impl RefUnwindSafe for A2aTask
impl Send for A2aTask
impl Sync for A2aTask
impl Unpin for A2aTask
impl UnsafeUnpin for A2aTask
impl UnwindSafe for A2aTask
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request