pub struct CeremonyDefinitionDraft { /* private fields */ }Implementations§
Source§impl CeremonyDefinitionDraft
impl CeremonyDefinitionDraft
Sourcepub fn new(
name: CeremonyName,
version: CeremonyVersion,
description: Option<CeremonyDescription>,
inputs: impl IntoIterator<Item = CeremonyInputDefinition>,
outputs: impl IntoIterator<Item = CeremonyOutputDefinition>,
states: impl IntoIterator<Item = CeremonyState>,
transitions: impl IntoIterator<Item = CeremonyTransition>,
steps: impl IntoIterator<Item = CeremonyStep>,
guards: impl IntoIterator<Item = CeremonyGuard>,
roles: impl IntoIterator<Item = CeremonyRole>,
) -> Self
pub fn new( name: CeremonyName, version: CeremonyVersion, description: Option<CeremonyDescription>, inputs: impl IntoIterator<Item = CeremonyInputDefinition>, outputs: impl IntoIterator<Item = CeremonyOutputDefinition>, states: impl IntoIterator<Item = CeremonyState>, transitions: impl IntoIterator<Item = CeremonyTransition>, steps: impl IntoIterator<Item = CeremonyStep>, guards: impl IntoIterator<Item = CeremonyGuard>, roles: impl IntoIterator<Item = CeremonyRole>, ) -> Self
Accept the declarations as given.
Construction never fails: a draft exists in order to describe what is wrong with it.
pub fn name(&self) -> &CeremonyName
pub fn version(&self) -> &CeremonyVersion
pub fn description(&self) -> Option<&CeremonyDescription>
pub fn states(&self) -> &[CeremonyState]
pub fn transitions(&self) -> &[CeremonyTransition]
pub fn steps(&self) -> &[CeremonyStep]
pub fn guards(&self) -> &[CeremonyGuard]
pub fn roles(&self) -> &[CeremonyRole]
Sourcepub fn analyze(&self) -> CeremonyValidationReport
pub fn analyze(&self) -> CeremonyValidationReport
Report every defect that would prevent publication.
Duplicate declarations are reported first, in the order
CeremonyDefinition::new assembles them, followed by the
structural analysis of the resulting state machine. Duplicates
do not stop the structural pass: an author fixing a draft wants
the whole picture, not the first obstacle.
Sourcepub fn publish(self) -> Result<CeremonyDefinition, DomainError>
pub fn publish(self) -> Result<CeremonyDefinition, DomainError>
Promote the draft into an always-valid definition.
Publication goes through CeremonyDefinition::new so there is
exactly one place where the invariants are enforced.
Trait Implementations§
Source§impl Clone for CeremonyDefinitionDraft
impl Clone for CeremonyDefinitionDraft
Source§fn clone(&self) -> CeremonyDefinitionDraft
fn clone(&self) -> CeremonyDefinitionDraft
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 CeremonyDefinitionDraft
impl Debug for CeremonyDefinitionDraft
Source§impl PartialEq for CeremonyDefinitionDraft
impl PartialEq for CeremonyDefinitionDraft
impl StructuralPartialEq for CeremonyDefinitionDraft
Auto Trait Implementations§
impl Freeze for CeremonyDefinitionDraft
impl RefUnwindSafe for CeremonyDefinitionDraft
impl Send for CeremonyDefinitionDraft
impl Sync for CeremonyDefinitionDraft
impl Unpin for CeremonyDefinitionDraft
impl UnsafeUnpin for CeremonyDefinitionDraft
impl UnwindSafe for CeremonyDefinitionDraft
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