pub struct Role<'a> {
pub declared_by: Option<&'a [IfaceId]>,
pub resources: Option<&'a [String]>,
pub cardinality: RequireCardinality,
pub annotations: &'a BTreeMap<String, Value>,
}Expand description
A role, as §2.2 reads it.
Fields§
§declared_by: Option<&'a [IfaceId]>The declaring contract’s uses, or None for a role a component’s
manifest declares.
resources: Option<&'a [String]>The requirement’s resources (templates), or None: every one.
cardinality: RequireCardinality§annotations: &'a BTreeMap<String, Value>Implementations§
Source§impl<'a> Role<'a>
impl<'a> Role<'a>
Sourcepub fn of(declaring: &'a Contract, req: &'a Requirement) -> Self
pub fn of(declaring: &'a Contract, req: &'a Requirement) -> Self
A role its contract declares.
Sourcepub fn of_manifest(req: &'a Requirement) -> Self
pub fn of_manifest(req: &'a Requirement) -> Self
A role a component’s manifest declares.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Forget for Role<'a>
impl<'a> Freeze for Role<'a>
impl<'a> Move for Role<'a>
impl<'a> RefUnwindSafe for Role<'a>
impl<'a> Send for Role<'a>
impl<'a> Sync for Role<'a>
impl<'a> Unpin for Role<'a>
impl<'a> UnsafeUnpin for Role<'a>where
&'a [IfaceId]: UnsafeUnpin,
&'a [String]: UnsafeUnpin,
&'a BTreeMap<String, Value>: UnsafeUnpin,
impl<'a> UnwindSafe for Role<'a>
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more