Skip to main content

RoleId

Trait RoleId 

Source
pub trait RoleId:
    Copy
    + Eq
    + Hash
    + Debug
    + Send
    + Sync
    + 'static {
    type Label: LabelId;

    // Required method
    fn role_name(&self) -> RoleName;

    // Provided method
    fn role_index(&self) -> Option<u32> { ... }
}
Expand description

Trait for role identifiers in choreographies

Roles are typically generated as enums per choreography, but any type implementing the required traits can serve as a role identifier.

Required Associated Types§

Source

type Label: LabelId

Protocol-specific label type associated with this role type.

Required Methods§

Source

fn role_name(&self) -> RoleName

Get the canonical role name for this role identifier.

Provided Methods§

Source

fn role_index(&self) -> Option<u32>

Optional index for parameterized roles.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§