#[non_exhaustive]pub struct LinkedPolicy { /* private fields */ }Expand description
A linked policy, i.e. a template with information to fill the slots and the id of the link.
To build a LinkedPolicy, you should use LinkedPolicy::new, which will validate that
the linked policy is provided values for all the slots in its body.
Implementations§
Source§impl LinkedPolicy
impl LinkedPolicy
Sourcepub fn new(
template: Arc<Template>,
values: HashMap<SlotId, EntityUID>,
instance_id: PolicyID,
) -> Result<LinkedPolicy, LinkingError>
pub fn new( template: Arc<Template>, values: HashMap<SlotId, EntityUID>, instance_id: PolicyID, ) -> Result<LinkedPolicy, LinkingError>
Create a new LinkedPolicy from a template, slot values, and an instance id.
Returns an error if any slot in the template is not provided a value.
Sourcepub fn into_static_policy(&self) -> Result<StaticPolicy, PstConstructionError>
pub fn into_static_policy(&self) -> Result<StaticPolicy, PstConstructionError>
Get the static policy statement that this linked policy represents.
Loses the link between the template and the instantiation (the template is cloned
and then the slots are replaced by the values in vals and the id is changed
to instance_id)
Trait Implementations§
Source§impl Clone for LinkedPolicy
impl Clone for LinkedPolicy
Source§fn clone(&self) -> LinkedPolicy
fn clone(&self) -> LinkedPolicy
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 LinkedPolicy
impl Debug for LinkedPolicy
Source§impl Display for LinkedPolicy
impl Display for LinkedPolicy
Source§impl From<LinkedPolicy> for Policy
impl From<LinkedPolicy> for Policy
Source§fn from(p: LinkedPolicy) -> Policy
fn from(p: LinkedPolicy) -> Policy
Converts to this type from the input type.
Source§impl PartialEq for LinkedPolicy
impl PartialEq for LinkedPolicy
Source§fn eq(&self, other: &LinkedPolicy) -> bool
fn eq(&self, other: &LinkedPolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for LinkedPolicy
impl StructuralPartialEq for LinkedPolicy
Auto Trait Implementations§
impl Freeze for LinkedPolicy
impl RefUnwindSafe for LinkedPolicy
impl Send for LinkedPolicy
impl Sync for LinkedPolicy
impl Unpin for LinkedPolicy
impl UnsafeUnpin for LinkedPolicy
impl UnwindSafe for LinkedPolicy
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.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