pub enum Restrictions {
Paused,
Blacklist(Vec<Address>),
Whitelist(Vec<Address>),
}Expand description
Restrictions that can be applied to the vault.
Supports Pausing, Whitelist, and Blacklist functionality.
Variants§
Paused
Vault is paused - all operations blocked.
Blacklist(Vec<Address>)
Blacklist - specified actors are blocked.
Whitelist(Vec<Address>)
Whitelist - only specified actors are allowed.
Implementations§
Source§impl Restrictions
impl Restrictions
Sourcepub const fn is_paused(&self) -> bool
pub const fn is_paused(&self) -> bool
Returns true if this value is of type Paused. Returns false otherwise
Sourcepub const fn is_blacklist(&self) -> bool
pub const fn is_blacklist(&self) -> bool
Returns true if this value is of type Blacklist. Returns false otherwise
Sourcepub const fn is_whitelist(&self) -> bool
pub const fn is_whitelist(&self) -> bool
Returns true if this value is of type Whitelist. Returns false otherwise
Source§impl Restrictions
impl Restrictions
pub fn normalized(self) -> Self
Sourcepub fn is_restricted(
&self,
actor_id: &Address,
self_id: &Address,
) -> Option<RestrictionKind>
pub fn is_restricted( &self, actor_id: &Address, self_id: &Address, ) -> Option<RestrictionKind>
Check if the given actor is restricted.
Returns Some(kind) if blocked, None if allowed.
The returned RestrictionKind is a lightweight tag — no allocations.
§Arguments
actor_id- The actor to check.self_id- The vault’s own identity (whitelist allows self by default).
Trait Implementations§
Source§impl BorshDeserialize for Restrictions
impl BorshDeserialize for Restrictions
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl BorshSchema for Restrictions
impl BorshSchema for Restrictions
Source§fn declaration() -> Declaration
fn declaration() -> Declaration
Get the name of the type without brackets.
Source§fn add_definitions_recursively(
definitions: &mut BTreeMap<Declaration, Definition>,
)
fn add_definitions_recursively( definitions: &mut BTreeMap<Declaration, Definition>, )
Recursively, using DFS, add type definitions required for this type.
Type definition partially explains how to serialize/deserialize a type.
Source§impl BorshSerialize for Restrictions
impl BorshSerialize for Restrictions
Source§impl Clone for Restrictions
impl Clone for Restrictions
Source§fn clone(&self) -> Restrictions
fn clone(&self) -> Restrictions
Returns a copy of the value. Read more
1.0.0 · 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 Restrictions
impl Debug for Restrictions
Source§impl<'de> Deserialize<'de> for Restrictions
impl<'de> Deserialize<'de> for Restrictions
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
Source§impl EnumExt for Restrictions
impl EnumExt for Restrictions
Source§impl JsonSchema for Restrictions
impl JsonSchema for Restrictions
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for Restrictions
impl PartialEq for Restrictions
Source§impl Serialize for Restrictions
impl Serialize for Restrictions
impl Eq for Restrictions
impl StructuralPartialEq for Restrictions
Auto Trait Implementations§
impl Freeze for Restrictions
impl RefUnwindSafe for Restrictions
impl Send for Restrictions
impl Sync for Restrictions
impl Unpin for Restrictions
impl UnwindSafe for Restrictions
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