Struct safe_network::types::UnseqMap [−][src]
pub struct UnseqMap { /* fields omitted */ }
Expand description
Map that is unpublished on the network. This data can only be fetched by the owner or
those in the permissions fields with Permission::Read
access.
Implementations
Gets a complete list of permissions.
Gets the permissions for the provided user.
Checks if the provided user is an owner.
Returns Ok(())
on success and Err(Error::AccessDenied)
if the user is not an
owner.
Checks permissions for given action
for the provided user.
Returns Err(Error::AccessDenied)
if the permission check has failed.
pub fn set_user_permissions(
&mut self,
user: PublicKey,
permissions: PermissionSet,
version: u64
) -> Result<()>
pub fn set_user_permissions(
&mut self,
user: PublicKey,
permissions: PermissionSet,
version: u64
) -> Result<()>
Inserts or updates permissions for the provided user.
Requires the new version
of the Map fields. If it does not match the
current version + 1, an error will be returned.
Deletes permissions for the provided user.
Requires the new version
of the Map fields. If it does not match the
current version + 1, an error will be returned.
pub fn del_user_permissions_without_validation(
&mut self,
user: PublicKey,
version: u64
) -> bool
pub fn del_user_permissions_without_validation(
&mut self,
user: PublicKey,
version: u64
) -> bool
Deletes user permissions without performing any validation.
Requires the new version
of the Map fields. If it does not match the
current version + 1, an error will be returned.
Changes the owner.
Requires the new version
of the Map fields. If it does not match the
current version + 1, an error will be returned.
Changes the owner without performing any validation.
Requires the new version
of the Map fields. If it does not match the
current version + 1, an error will be returned.
Returns true if action
is allowed for the provided user.
pub fn new_with_data(
name: XorName,
tag: u64,
data: UnseqEntries,
permissions: BTreeMap<PublicKey, PermissionSet>,
owner: PublicKey
) -> Self
pub fn new_with_data(
name: XorName,
tag: u64,
data: UnseqEntries,
permissions: BTreeMap<PublicKey, PermissionSet>,
owner: PublicKey
) -> Self
Creates a new unsequenced Map with entries and permissions.
Returns all entries.
Removes and returns all entries.
pub fn mutate_entries(
&mut self,
actions: UnseqEntryActions,
requester: &PublicKey
) -> Result<()>
pub fn mutate_entries(
&mut self,
actions: UnseqEntryActions,
requester: &PublicKey
) -> Result<()>
Mutates entries based on actions
for the provided user.
Returns Err(InvalidEntryActions)
if the mutation parameters are invalid.
Trait Implementations
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
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for UnseqData
impl UnwindSafe for UnseqData
Blanket Implementations
Mutably borrows from an owned value. Read more
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V