pub struct ProtectionPolicy { /* private fields */ }Expand description
Per-Protection state collection. The default for any protection
not explicitly named is ProtectionState::Strict — meaning a
freshly-constructed ProtectionPolicy produces the same behaviour
as the current hard MIN_ABI = 6 floor.
Implementations§
Source§impl ProtectionPolicy
impl ProtectionPolicy
Sourcepub fn strict_all() -> Self
pub fn strict_all() -> Self
A policy with no overrides — every protection defaults to
Strict. Equivalent to the pre-Protection behaviour.
Sourcepub fn state(&self, protection: Protection) -> ProtectionState
pub fn state(&self, protection: Protection) -> ProtectionState
Look up the state for a given protection. Returns Strict
for protections not explicitly named.
Sourcepub fn iter(&self) -> impl Iterator<Item = (Protection, ProtectionState)> + '_
pub fn iter(&self) -> impl Iterator<Item = (Protection, ProtectionState)> + '_
Iterator over every protection paired with its resolved state
(including the implicit Strict for unnamed ones).
Trait Implementations§
Source§impl Clone for ProtectionPolicy
impl Clone for ProtectionPolicy
Source§fn clone(&self) -> ProtectionPolicy
fn clone(&self) -> ProtectionPolicy
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 ProtectionPolicy
impl Debug for ProtectionPolicy
Source§impl Default for ProtectionPolicy
impl Default for ProtectionPolicy
Source§fn default() -> ProtectionPolicy
fn default() -> ProtectionPolicy
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ProtectionPolicy
impl<'de> Deserialize<'de> for ProtectionPolicy
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 ProtectionPolicy
Source§impl PartialEq for ProtectionPolicy
impl PartialEq for ProtectionPolicy
Source§fn eq(&self, other: &ProtectionPolicy) -> bool
fn eq(&self, other: &ProtectionPolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ProtectionPolicy
impl Serialize for ProtectionPolicy
impl StructuralPartialEq for ProtectionPolicy
Auto Trait Implementations§
impl Freeze for ProtectionPolicy
impl RefUnwindSafe for ProtectionPolicy
impl Send for ProtectionPolicy
impl Sync for ProtectionPolicy
impl Unpin for ProtectionPolicy
impl UnsafeUnpin for ProtectionPolicy
impl UnwindSafe for ProtectionPolicy
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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.