Skip to main content

Choreography

Struct Choreography 

Source
pub struct Choreography {
    pub name: Ident,
    pub namespace: Option<String>,
    pub roles: Vec<Role>,
    pub protocol: Protocol,
    pub attrs: HashMap<String, String>,
}
Expand description

A complete choreographic protocol specification

Fields§

§name: Ident

Protocol name

§namespace: Option<String>

Optional namespace for the protocol

§roles: Vec<Role>

Participating roles

§protocol: Protocol

The protocol specification

§attrs: HashMap<String, String>

Metadata and attributes

Implementations§

Source§

impl Choreography

Source

pub fn qualified_name(&self) -> String

Get the qualified name of the choreography (namespace::name or just name)

Source

pub fn validate(&self) -> Result<(), ValidationError>

Validate the choreography for correctness

§Errors

Returns ValidationError if the choreography is invalid (unused roles, malformed protocol, duplicate/missing proof bundles, or missing capabilities).

Source

pub fn language_tier_status(&self) -> LanguageTierStatus

Source

pub fn authority_metatheory_status(&self) -> AuthorityMetatheoryStatus

Source

pub fn get_attributes(&self) -> &HashMap<String, String>

Get choreography-level attributes/annotations

Source

pub fn get_attributes_mut(&mut self) -> &mut HashMap<String, String>

Get mutable reference to choreography-level attributes

Source

pub fn get_attribute(&self, key: &str) -> Option<&String>

Get a specific choreography attribute

Source

pub fn set_attribute(&mut self, key: String, value: String)

Set a choreography attribute

Source

pub fn remove_attribute(&mut self, key: &str) -> Option<String>

Remove a choreography attribute

Source

pub fn has_attribute(&self, key: &str) -> bool

Check if choreography has a specific attribute

Source

pub fn get_attribute_as<T>(&self, key: &str) -> Option<T>
where T: FromStr,

Get attribute as a specific type

Source

pub fn get_attribute_as_bool(&self, key: &str) -> Option<bool>

Get attribute as boolean

Source

pub fn clear_attributes(&mut self)

Clear all choreography attributes

Source

pub fn attribute_count(&self) -> usize

Count of choreography attributes

Source

pub fn attribute_keys(&self) -> Vec<&String>

Get all attribute keys

Source

pub fn validate_required_attributes( &self, required_keys: &[&str], ) -> Result<(), Vec<String>>

Validate that required attributes are present

Source

pub fn find_nodes_with_annotation(&self, key: &str) -> Vec<&Protocol>

Find all protocol nodes with a specific annotation

Source

pub fn find_nodes_with_annotation_value( &self, key: &str, value: &str, ) -> Vec<&Protocol>

Find all protocol nodes with a specific annotation value

Source

pub fn total_annotation_count(&self) -> usize

Count total annotations across the entire choreography

Source

pub fn set_theorem_packs( &mut self, theorem_packs: &[TheoremPackDeclaration], ) -> Result<(), String>

Set theorem-pack declarations for this choreography.

Source

pub fn theorem_packs(&self) -> Vec<TheoremPackDeclaration>

Get typed theorem-pack declarations.

Source

pub fn set_required_theorem_packs( &mut self, required: &[String], ) -> Result<(), String>

Set protocol-required theorem packs.

Source

pub fn required_theorem_packs(&self) -> Vec<String>

Get protocol-required theorem packs.

Source

pub fn set_inferred_required_theorem_packs( &mut self, required: &[String], ) -> Result<(), String>

Set inferred protocol-required theorem packs.

Source

pub fn inferred_required_theorem_packs(&self) -> Vec<String>

Get inferred protocol-required theorem packs.

Source

pub fn set_role_sets( &mut self, role_sets: &[RoleSetDeclaration], ) -> Result<(), String>

Set role-set declarations for this choreography.

Source

pub fn role_sets(&self) -> Vec<RoleSetDeclaration>

Get typed role-set declarations.

Source

pub fn set_topologies( &mut self, topologies: &[TopologyDeclaration], ) -> Result<(), String>

Set topology declarations for this choreography.

Source

pub fn topologies(&self) -> Vec<TopologyDeclaration>

Get typed topology declarations.

Source

pub fn set_type_declarations( &mut self, decls: &[TypeDeclaration], ) -> Result<(), String>

Set nominal type declarations for this choreography.

Source

pub fn type_declarations(&self) -> Vec<TypeDeclaration>

Get nominal type declarations.

Source

pub fn set_effect_interface_declarations( &mut self, decls: &[EffectInterfaceDeclaration], ) -> Result<(), String>

Set nominal effect interface declarations for this choreography.

Source

pub fn effect_interface_declarations(&self) -> Vec<EffectInterfaceDeclaration>

Get nominal effect interface declarations.

Source

pub fn effect_contract_declarations(&self) -> Vec<EffectContractDeclaration>

Derive runtime-facing effect metadata from nominal effect declarations and protocol uses dependencies.

Source

pub fn set_protocol_uses(&mut self, uses: &[String]) -> Result<(), String>

Set explicit protocol effect dependencies.

Source

pub fn protocol_uses(&self) -> Vec<String>

Get explicit protocol effect dependencies.

Source

pub fn set_region_declarations( &mut self, decls: &[RegionDeclaration], ) -> Result<(), String>

Set region declarations for this choreography.

Source

pub fn region_declarations(&self) -> Vec<RegionDeclaration>

Get region declarations.

Source

pub fn set_operation_declarations( &mut self, decls: &[OperationDeclaration], ) -> Result<(), String>

Set operation declarations for this choreography.

Source

pub fn operation_declarations(&self) -> Vec<OperationDeclaration>

Get operation declarations.

Source

pub fn set_guest_runtime_declarations( &mut self, decls: &[GuestRuntimeDeclaration], ) -> Result<(), String>

Set guest-runtime declarations for this choreography.

Source

pub fn guest_runtime_declarations(&self) -> Vec<GuestRuntimeDeclaration>

Get guest-runtime declarations.

Source

pub fn set_execution_profile_declarations( &mut self, decls: &[ExecutionProfileDeclaration], ) -> Result<(), String>

Set execution-profile declarations for this choreography.

Source

pub fn execution_profile_declarations(&self) -> Vec<ExecutionProfileDeclaration>

Get execution-profile declarations.

Source

pub fn set_protocol_execution_profiles( &mut self, profiles: &[String], ) -> Result<(), String>

Set protocol-selected execution profiles.

Source

pub fn protocol_execution_profiles(&self) -> Vec<String>

Get protocol-selected execution profiles.

Source

pub fn set_agreement_profile_declarations( &mut self, decls: &[AgreementProfileDeclaration], ) -> Result<(), String>

Set reusable agreement-profile declarations for this choreography.

Source

pub fn agreement_profile_declarations(&self) -> Vec<AgreementProfileDeclaration>

Get reusable agreement-profile declarations.

Trait Implementations§

Source§

impl Debug for Choreography

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Az for T

Source§

fn az<Dst>(self) -> Dst
where T: Cast<Dst>,

Casts the value.
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Src, Dst> CastFrom<Src> for Dst
where Src: Cast<Dst>,

Source§

fn cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> CheckedAs for T

Source§

fn checked_as<Dst>(self) -> Option<Dst>
where T: CheckedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> CheckedCastFrom<Src> for Dst
where Src: CheckedCast<Dst>,

Source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<Src, Dst> LosslessTryInto<Dst> for Src
where Dst: LosslessTryFrom<Src>,

Source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
Source§

impl<Src, Dst> LossyInto<Dst> for Src
where Dst: LossyFrom<Src>,

Source§

fn lossy_into(self) -> Dst

Performs the conversion.
Source§

impl<T> OverflowingAs for T

Source§

fn overflowing_as<Dst>(self) -> (Dst, bool)
where T: OverflowingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dst
where Src: OverflowingCast<Dst>,

Source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SaturatingAs for T

Source§

fn saturating_as<Dst>(self) -> Dst
where T: SaturatingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dst
where Src: SaturatingCast<Dst>,

Source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T> StrictAs for T

Source§

fn strict_as<Dst>(self) -> Dst
where T: StrictCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> StrictCastFrom<Src> for Dst
where Src: StrictCast<Dst>,

Source§

fn strict_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> UnwrappedAs for T

Source§

fn unwrapped_as<Dst>(self) -> Dst
where T: UnwrappedCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dst
where Src: UnwrappedCast<Dst>,

Source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> WrappingAs for T

Source§

fn wrapping_as<Dst>(self) -> Dst
where T: WrappingCast<Dst>,

Casts the value.
Source§

impl<Src, Dst> WrappingCastFrom<Src> for Dst
where Src: WrappingCast<Dst>,

Source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.