pub struct WorkflowReadRegistry { /* private fields */ }Expand description
The read-only projection of a WorkflowRegistry: definitions, and the
loading half of each executor.
A registry built from WorkflowDefinitions alone carries no loader, and
WorkflowReadRegistry::require_loader then says so rather than silently
reading nothing — which is exactly what a caller that seeds the state wants,
because it should never reach a loader in the first place.
Implementations§
Source§impl WorkflowReadRegistry
impl WorkflowReadRegistry
Sourcepub fn from_definitions(definitions: WorkflowDefinitions) -> Self
pub fn from_definitions(definitions: WorkflowDefinitions) -> Self
Definitions with no loader at all.
Sourcepub const fn definitions(&self) -> &WorkflowDefinitions
pub const fn definitions(&self) -> &WorkflowDefinitions
The definitions.
Sourcepub fn loader(&self, key: &WorkflowKey) -> Option<&Arc<dyn ErasedCaseLoader>>
pub fn loader(&self, key: &WorkflowKey) -> Option<&Arc<dyn ErasedCaseLoader>>
The loading half of one workflow’s executor, when there is one.
Sourcepub fn require_loader(
&self,
key: &WorkflowKey,
) -> Result<&Arc<dyn ErasedCaseLoader>, ErasureError>
pub fn require_loader( &self, key: &WorkflowKey, ) -> Result<&Arc<dyn ErasedCaseLoader>, ErasureError>
The loading half of one workflow’s executor.
§Errors
ErasureError::UnknownWorkflow when the workflow is not registered or
this projection carries no loader for it.
Sourcepub fn has_no_loaders(&self) -> bool
pub fn has_no_loaders(&self) -> bool
Returns true when no loader is carried at all.
Trait Implementations§
Source§impl Clone for WorkflowReadRegistry
impl Clone for WorkflowReadRegistry
Source§impl Debug for WorkflowReadRegistry
impl Debug for WorkflowReadRegistry
Source§impl Default for WorkflowReadRegistry
impl Default for WorkflowReadRegistry
Source§impl From<&WorkflowRegistry> for WorkflowReadRegistry
impl From<&WorkflowRegistry> for WorkflowReadRegistry
Source§fn from(registry: &WorkflowRegistry) -> Self
fn from(registry: &WorkflowRegistry) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for WorkflowReadRegistry
impl !UnwindSafe for WorkflowReadRegistry
impl Freeze for WorkflowReadRegistry
impl Send for WorkflowReadRegistry
impl Sync for WorkflowReadRegistry
impl Unpin for WorkflowReadRegistry
impl UnsafeUnpin for WorkflowReadRegistry
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