pub struct Choreography {
pub name: String,
/* private fields */
}Expand description
A global choreography specification.
Fields§
§name: StringName of this choreography (e.g., “filter_update”).
Implementations§
Source§impl Choreography
impl Choreography
Sourcepub fn step(
&mut self,
participant: impl Into<String>,
action: Action,
) -> &mut Self
pub fn step( &mut self, participant: impl Into<String>, action: Action, ) -> &mut Self
Add a step to the choreography.
Sourcepub fn steps(&self) -> &[ChoreographyStep]
pub fn steps(&self) -> &[ChoreographyStep]
Get all steps.
Sourcepub fn participants(&self) -> BTreeSet<ParticipantId>
pub fn participants(&self) -> BTreeSet<ParticipantId>
Get all unique participants.
Sourcepub fn message_types(&self) -> BTreeSet<MessageType>
pub fn message_types(&self) -> BTreeSet<MessageType>
Get all message types used.
Sourcepub fn project(&self) -> Projection
pub fn project(&self) -> Projection
Project the choreography to per-participant handlers.
Sourcepub fn verify_deadlock_free(&self) -> bool
pub fn verify_deadlock_free(&self) -> bool
Verify that the choreography is deadlock-free.
A choreography is deadlock-free if:
- Every emitted message has at least one handler.
- Every handled message has at least one emitter.
- The message dependency graph is acyclic.
Sourcepub fn completeness_report(&self) -> CompletenessReport
pub fn completeness_report(&self) -> CompletenessReport
Completeness check: are there unhandled messages or unmatched handlers?
Trait Implementations§
Source§impl Clone for Choreography
impl Clone for Choreography
Source§fn clone(&self) -> Choreography
fn clone(&self) -> Choreography
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for Choreography
impl RefUnwindSafe for Choreography
impl Send for Choreography
impl Sync for Choreography
impl Unpin for Choreography
impl UnsafeUnpin for Choreography
impl UnwindSafe for Choreography
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