pub struct ActivityContext { /* private fields */ }Expand description
Context provided to activity functions during execution.
Implementations§
Source§impl ActivityContext
impl ActivityContext
pub fn new( orchestration_id: String, task_id: i32, task_execution_id: String, ) -> Self
Sourcepub fn with_propagated_history(self, history: Option<PropagatedHistory>) -> Self
pub fn with_propagated_history(self, history: Option<PropagatedHistory>) -> Self
Construct an activity context with an attached propagated history
(delivered by the worker via ActivityRequest.propagated_history).
pub fn orchestration_id(&self) -> &str
pub fn task_id(&self) -> i32
Sourcepub fn task_execution_id(&self) -> &str
pub fn task_execution_id(&self) -> &str
A unique identifier for this specific activity execution.
Unlike task_id, which is deterministic and reused across retries,
task_execution_id is unique per attempt and can be used for
idempotency keys or deduplication.
Sourcepub fn propagated_history(&self) -> Option<&PropagatedHistory>
pub fn propagated_history(&self) -> Option<&PropagatedHistory>
Returns history forwarded from the calling workflow, if the workflow
scheduled this activity with a non-None history propagation scope.
Auto Trait Implementations§
impl Freeze for ActivityContext
impl RefUnwindSafe for ActivityContext
impl Send for ActivityContext
impl Sync for ActivityContext
impl Unpin for ActivityContext
impl UnsafeUnpin for ActivityContext
impl UnwindSafe for ActivityContext
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
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