pub struct PolicyIdentity { /* private fields */ }Expand description
PolicyIdentity
Bounded semantic identity for one runtime bootstrap policy configuration.
The name identifies the policy family, version changes when its semantics
change, and the optional digest distinguishes runtime configuration. The
digest is supplied by the policy implementation; ic-memory does not choose
or compute a hashing algorithm.
This identity is an in-memory repeat-call and diagnostic binding. It is not persisted to the allocation ledger.
Implementations§
Source§impl PolicyIdentity
impl PolicyIdentity
Sourcepub fn new(
name: impl Into<String>,
version: u32,
) -> Result<Self, PolicyIdentityError>
pub fn new( name: impl Into<String>, version: u32, ) -> Result<Self, PolicyIdentityError>
Construct a validated policy identity without a configuration digest.
Sourcepub const fn with_configuration_digest(self, digest: [u8; 32]) -> Self
pub const fn with_configuration_digest(self, digest: [u8; 32]) -> Self
Attach a caller-computed configuration digest.
Sourcepub const fn configuration_digest(&self) -> Option<&[u8; 32]>
pub const fn configuration_digest(&self) -> Option<&[u8; 32]>
Borrow the optional caller-computed configuration digest.
Trait Implementations§
Source§impl Clone for PolicyIdentity
impl Clone for PolicyIdentity
Source§fn clone(&self) -> PolicyIdentity
fn clone(&self) -> PolicyIdentity
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 PolicyIdentity
impl Debug for PolicyIdentity
Source§impl<'de> Deserialize<'de> for PolicyIdentity
impl<'de> Deserialize<'de> for PolicyIdentity
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for PolicyIdentity
Source§impl PartialEq for PolicyIdentity
impl PartialEq for PolicyIdentity
Source§impl Serialize for PolicyIdentity
impl Serialize for PolicyIdentity
impl StructuralPartialEq for PolicyIdentity
Auto Trait Implementations§
impl Freeze for PolicyIdentity
impl RefUnwindSafe for PolicyIdentity
impl Send for PolicyIdentity
impl Sync for PolicyIdentity
impl Unpin for PolicyIdentity
impl UnsafeUnpin for PolicyIdentity
impl UnwindSafe for PolicyIdentity
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