pub struct Authorization {
pub address: Address,
pub chain: Option<Chain>,
pub channels: Vec<String>,
pub types: Vec<MessageType>,
pub post_types: Vec<String>,
pub aggregate_keys: Vec<String>,
}Expand description
A single authorization entry granting a delegate address permission to act on behalf of the owner.
Fields§
§address: Address§chain: Option<Chain>§channels: Vec<String>§types: Vec<MessageType>§post_types: Vec<String>§aggregate_keys: Vec<String>Implementations§
Source§impl Authorization
impl Authorization
Sourcepub fn try_merge(&self, other: &Self) -> Option<Self>
pub fn try_merge(&self, other: &Self) -> Option<Self>
Returns a merged Authorization if self and other can be safely
combined into one entry without changing the set of allowed messages.
Returns None if they should remain separate.
The merge rule: same address and chain, and of the four list
fields (channels, types, post_types, aggregate_keys) at most
one differs as a set, and both sides of that field are non-empty.
Empty list (= wildcard) is never merged with a restricted list,
because set-union would either narrow the wildcard or broaden the
restricted side.
Trait Implementations§
Source§impl Clone for Authorization
impl Clone for Authorization
Source§fn clone(&self) -> Authorization
fn clone(&self) -> Authorization
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 Authorization
impl Debug for Authorization
Source§impl<'de> Deserialize<'de> for Authorization
impl<'de> Deserialize<'de> for Authorization
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 PartialEq for Authorization
impl PartialEq for Authorization
Source§fn eq(&self, other: &Authorization) -> bool
fn eq(&self, other: &Authorization) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for Authorization
impl Serialize for Authorization
impl Eq for Authorization
impl StructuralPartialEq for Authorization
Auto Trait Implementations§
impl Freeze for Authorization
impl RefUnwindSafe for Authorization
impl Send for Authorization
impl Sync for Authorization
impl Unpin for Authorization
impl UnsafeUnpin for Authorization
impl UnwindSafe for Authorization
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