pub struct OperationContext { /* private fields */ }Expand description
Traceable execution context supplied by the calling product.
Implementations§
Source§impl OperationContext
impl OperationContext
Sourcepub fn with_correlation_id(self, correlation_id: CorrelationId) -> Self
pub fn with_correlation_id(self, correlation_id: CorrelationId) -> Self
Uses an existing workflow correlation identity.
Sourcepub fn with_causation_id(self, causation_id: OperationId) -> Self
pub fn with_causation_id(self, causation_id: OperationId) -> Self
Records the operation that caused this operation.
Sourcepub fn with_actor(self, actor: ActorRef) -> Self
pub fn with_actor(self, actor: ActorRef) -> Self
Records the requesting actor.
Sourcepub fn with_idempotency_key(self, idempotency_key: IdempotencyKey) -> Self
pub fn with_idempotency_key(self, idempotency_key: IdempotencyKey) -> Self
Adds a caller-provided idempotency key.
Sourcepub fn with_deadline(self, deadline: Timestamp) -> Self
pub fn with_deadline(self, deadline: Timestamp) -> Self
Sets an absolute deadline.
Sourcepub fn with_trace(self, trace: TraceContext) -> Self
pub fn with_trace(self, trace: TraceContext) -> Self
Adds trace context.
Sourcepub fn operation_id(&self) -> &OperationId
pub fn operation_id(&self) -> &OperationId
Returns the execution identity.
Sourcepub fn correlation_id(&self) -> &CorrelationId
pub fn correlation_id(&self) -> &CorrelationId
Returns the workflow correlation identity.
Sourcepub fn causation_id(&self) -> Option<&OperationId>
pub fn causation_id(&self) -> Option<&OperationId>
Returns the causal operation when present.
Sourcepub fn idempotency_key(&self) -> Option<&IdempotencyKey>
pub fn idempotency_key(&self) -> Option<&IdempotencyKey>
Returns the idempotency key when present.
Sourcepub fn trace(&self) -> &TraceContext
pub fn trace(&self) -> &TraceContext
Returns propagated trace context.
Trait Implementations§
Source§impl Clone for OperationContext
impl Clone for OperationContext
Source§fn clone(&self) -> OperationContext
fn clone(&self) -> OperationContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 OperationContext
impl Debug for OperationContext
Source§impl Default for OperationContext
impl Default for OperationContext
Source§impl<'de> Deserialize<'de> for OperationContext
impl<'de> Deserialize<'de> for OperationContext
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 JsonSchema for OperationContext
impl JsonSchema for OperationContext
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for OperationContext
impl PartialEq for OperationContext
Source§fn eq(&self, other: &OperationContext) -> bool
fn eq(&self, other: &OperationContext) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for OperationContext
impl Serialize for OperationContext
impl Eq for OperationContext
impl StructuralPartialEq for OperationContext
Auto Trait Implementations§
impl Freeze for OperationContext
impl RefUnwindSafe for OperationContext
impl Send for OperationContext
impl Sync for OperationContext
impl Unpin for OperationContext
impl UnsafeUnpin for OperationContext
impl UnwindSafe for OperationContext
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.