pub struct WorkflowDefinitions { /* private fields */ }Expand description
The pure half of a set of workflows: definitions only.
Built by WorkflowRegistry::definitions, or from erased definitions
directly when there is no registry — a corpus replayed against a projector
has states in hand and no executor at all.
Implementations§
Source§impl WorkflowDefinitions
impl WorkflowDefinitions
Sourcepub fn with(self, definition: Arc<dyn ErasedWorkflow>) -> Self
pub fn with(self, definition: Arc<dyn ErasedWorkflow>) -> Self
Adds one definition, keyed by ErasedWorkflow::key. A repeated key
replaces the previous entry.
Sourcepub fn get(&self, key: &WorkflowKey) -> Option<&Arc<dyn ErasedWorkflow>>
pub fn get(&self, key: &WorkflowKey) -> Option<&Arc<dyn ErasedWorkflow>>
Looks a definition up.
Sourcepub fn require(
&self,
key: &WorkflowKey,
) -> Result<&Arc<dyn ErasedWorkflow>, ErasureError>
pub fn require( &self, key: &WorkflowKey, ) -> Result<&Arc<dyn ErasedWorkflow>, ErasureError>
Looks a definition up, failing when unknown.
§Errors
ErasureError::UnknownWorkflow when the key is not present.
Sourcepub fn contains(&self, key: &WorkflowKey) -> bool
pub fn contains(&self, key: &WorkflowKey) -> bool
Returns true when the key is present.
Sourcepub fn keys(&self) -> impl Iterator<Item = &WorkflowKey>
pub fn keys(&self) -> impl Iterator<Item = &WorkflowKey>
Keys in insertion order.
Sourcepub fn iter(&self) -> impl Iterator<Item = &Arc<dyn ErasedWorkflow>>
pub fn iter(&self) -> impl Iterator<Item = &Arc<dyn ErasedWorkflow>>
Definitions in insertion order.
Trait Implementations§
Source§impl Clone for WorkflowDefinitions
impl Clone for WorkflowDefinitions
Source§impl Debug for WorkflowDefinitions
impl Debug for WorkflowDefinitions
Source§impl Default for WorkflowDefinitions
impl Default for WorkflowDefinitions
Source§impl From<&Arc<WorkflowRegistry>> for WorkflowDefinitions
impl From<&Arc<WorkflowRegistry>> for WorkflowDefinitions
Source§fn from(registry: &Arc<WorkflowRegistry>) -> Self
fn from(registry: &Arc<WorkflowRegistry>) -> Self
Converts to this type from the input type.
Source§impl From<&WorkflowRegistry> for WorkflowDefinitions
impl From<&WorkflowRegistry> for WorkflowDefinitions
Source§fn from(registry: &WorkflowRegistry) -> Self
fn from(registry: &WorkflowRegistry) -> Self
Converts to this type from the input type.
Source§impl From<Arc<WorkflowRegistry>> for WorkflowDefinitions
impl From<Arc<WorkflowRegistry>> for WorkflowDefinitions
Source§fn from(registry: Arc<WorkflowRegistry>) -> Self
fn from(registry: Arc<WorkflowRegistry>) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for WorkflowDefinitions
impl !UnwindSafe for WorkflowDefinitions
impl Freeze for WorkflowDefinitions
impl Send for WorkflowDefinitions
impl Sync for WorkflowDefinitions
impl Unpin for WorkflowDefinitions
impl UnsafeUnpin for WorkflowDefinitions
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