pub struct ProcessIdentity {
pub process_id: ProcessId,
pub tenant_id: TenantId,
pub workflow_id: WorkflowId,
/* private fields */
}Expand description
A serializable value type that bundles all four process identifiers.
Use ProcessIdentity to persist process routing information without
keeping a live Process handle. When a new inbound EDIFACT message
arrives and must be routed to a running process, look up the identity in
your routing table and call Process::from_identity to attach.
§Example
ⓘ
// Persist after process creation:
let identity = process.identity();
routing_table.insert(utilmd_conversation_id, identity.clone());
// Restore on a subsequent message:
let identity = routing_table.get(&aperak_conversation_id)?;
let process = Process::<MyWorkflow, _>::from_identity(store, identity);
process.execute(HandleAperak { .. }).await?;Fields§
§process_id: ProcessIdThe stable process identifier.
tenant_id: TenantIdThe tenant that owns this process.
workflow_id: WorkflowIdThe workflow version under which this process was created.
Implementations§
Source§impl ProcessIdentity
impl ProcessIdentity
Sourcepub fn new(
process_id: ProcessId,
tenant_id: TenantId,
workflow_id: WorkflowId,
) -> Self
pub fn new( process_id: ProcessId, tenant_id: TenantId, workflow_id: WorkflowId, ) -> Self
Construct a ProcessIdentity, deriving stream_id automatically from
tenant_id and process_id.
stream_id is always StreamId::for_process(tenant_id, &process_id) —
callers must not supply it independently to avoid accidental mismatches.
Trait Implementations§
Source§impl Clone for ProcessIdentity
impl Clone for ProcessIdentity
Source§fn clone(&self) -> ProcessIdentity
fn clone(&self) -> ProcessIdentity
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 ProcessIdentity
impl Debug for ProcessIdentity
Source§impl<'de> Deserialize<'de> for ProcessIdentity
impl<'de> Deserialize<'de> for ProcessIdentity
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
impl Eq for ProcessIdentity
Source§impl PartialEq for ProcessIdentity
impl PartialEq for ProcessIdentity
Source§fn eq(&self, other: &ProcessIdentity) -> bool
fn eq(&self, other: &ProcessIdentity) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ProcessIdentity
impl Serialize for ProcessIdentity
impl StructuralPartialEq for ProcessIdentity
Auto Trait Implementations§
impl Freeze for ProcessIdentity
impl RefUnwindSafe for ProcessIdentity
impl Send for ProcessIdentity
impl Sync for ProcessIdentity
impl Unpin for ProcessIdentity
impl UnsafeUnpin for ProcessIdentity
impl UnwindSafe for ProcessIdentity
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