pub struct OperationIdentifier {
pub operation_id: String,
pub parent_id: Option<String>,
pub name: Option<String>,
}Expand description
Identifies an operation within a durable execution.
Each operation has a unique ID that is deterministically generated based on the parent context and step counter. This ensures that the same operation gets the same ID across replays.
Fields§
§operation_id: StringThe unique operation ID (deterministically generated)
parent_id: Option<String>The parent operation ID (None for root operations)
name: Option<String>Optional human-readable name for the operation
Implementations§
Source§impl OperationIdentifier
impl OperationIdentifier
Sourcepub fn new(
operation_id: impl Into<String>,
parent_id: Option<String>,
name: Option<String>,
) -> Self
pub fn new( operation_id: impl Into<String>, parent_id: Option<String>, name: Option<String>, ) -> Self
Creates a new OperationIdentifier with the given values.
Sourcepub fn root(operation_id: impl Into<String>) -> Self
pub fn root(operation_id: impl Into<String>) -> Self
Creates a root operation identifier (no parent).
Sourcepub fn with_parent(
operation_id: impl Into<String>,
parent_id: impl Into<String>,
) -> Self
pub fn with_parent( operation_id: impl Into<String>, parent_id: impl Into<String>, ) -> Self
Creates an operation identifier with a parent.
Sourcepub fn with_name(self, name: impl Into<String>) -> Self
pub fn with_name(self, name: impl Into<String>) -> Self
Sets the name for this operation identifier.
Sourcepub fn operation_id_typed(&self) -> OperationId
pub fn operation_id_typed(&self) -> OperationId
Returns the operation ID as an OperationId newtype.
Sourcepub fn parent_id_typed(&self) -> Option<OperationId>
pub fn parent_id_typed(&self) -> Option<OperationId>
Returns the parent ID as an OperationId newtype, if present.
Sourcepub fn apply_to(&self, update: OperationUpdate) -> OperationUpdate
pub fn apply_to(&self, update: OperationUpdate) -> OperationUpdate
Applies this identifier’s parent_id and name to an OperationUpdate.
This is a convenience method to avoid repeated boilerplate when building operation updates across handlers.
Trait Implementations§
Source§impl Clone for OperationIdentifier
impl Clone for OperationIdentifier
Source§fn clone(&self) -> OperationIdentifier
fn clone(&self) -> OperationIdentifier
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OperationIdentifier
impl Debug for OperationIdentifier
Source§impl Display for OperationIdentifier
impl Display for OperationIdentifier
Source§impl Hash for OperationIdentifier
impl Hash for OperationIdentifier
Source§impl PartialEq for OperationIdentifier
impl PartialEq for OperationIdentifier
impl Eq for OperationIdentifier
impl StructuralPartialEq for OperationIdentifier
Auto Trait Implementations§
impl Freeze for OperationIdentifier
impl RefUnwindSafe for OperationIdentifier
impl Send for OperationIdentifier
impl Sync for OperationIdentifier
impl Unpin for OperationIdentifier
impl UnsafeUnpin for OperationIdentifier
impl UnwindSafe for OperationIdentifier
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.