Struct routing::MutableData [−][src]
pub struct MutableData { /* fields omitted */ }
Mutable data.
Methods
impl MutableData
[src]
impl MutableData
pub fn new(
name: XorName,
tag: u64,
permissions: BTreeMap<User, PermissionSet>,
data: BTreeMap<Vec<u8>, Value>,
owners: BTreeSet<PublicKey>
) -> Result<MutableData, ClientError>
[src]
pub fn new(
name: XorName,
tag: u64,
permissions: BTreeMap<User, PermissionSet>,
data: BTreeMap<Vec<u8>, Value>,
owners: BTreeSet<PublicKey>
) -> Result<MutableData, ClientError>
Creates a new MutableData
pub fn validate(&self) -> Result<(), ClientError>
[src]
pub fn validate(&self) -> Result<(), ClientError>
Validate this data.
pub fn shell(&self) -> MutableData
[src]
pub fn shell(&self) -> MutableData
Returns the shell of this data. Shell contains the same fields as the data itself, except the entries.
pub fn name(&self) -> &XorName
[src]
pub fn name(&self) -> &XorName
Returns the name.
pub fn tag(&self) -> u64
[src]
pub fn tag(&self) -> u64
Returns the type tag of this MutableData
pub fn version(&self) -> u64
[src]
pub fn version(&self) -> u64
Returns the current version of this MutableData
pub fn owners(&self) -> &BTreeSet<PublicKey>
[src]
pub fn owners(&self) -> &BTreeSet<PublicKey>
Returns the owner keys
pub fn get(&self, key: &[u8]) -> Option<&Value>
[src]
pub fn get(&self, key: &[u8]) -> Option<&Value>
Returns a value by the given key
pub fn keys(&self) -> BTreeSet<&Vec<u8>>
[src]
pub fn keys(&self) -> BTreeSet<&Vec<u8>>
Returns keys of all entries
pub fn values(&self) -> Vec<&Value>
[src]
pub fn values(&self) -> Vec<&Value>
Returns values of all entries
pub fn entries(&self) -> &BTreeMap<Vec<u8>, Value>
[src]
pub fn entries(&self) -> &BTreeMap<Vec<u8>, Value>
Returns all entries
pub fn take_entries(&mut self) -> BTreeMap<Vec<u8>, Value>
[src]
pub fn take_entries(&mut self) -> BTreeMap<Vec<u8>, Value>
Removes and returns all entries
pub fn mutate_entries(
&mut self,
actions: BTreeMap<Vec<u8>, EntryAction>,
requester: PublicKey
) -> Result<(), ClientError>
[src]
pub fn mutate_entries(
&mut self,
actions: BTreeMap<Vec<u8>, EntryAction>,
requester: PublicKey
) -> Result<(), ClientError>
Mutates entries (key + value pairs) in bulk
pub fn mutate_entries_without_validation(
&mut self,
actions: BTreeMap<Vec<u8>, EntryAction>
)
[src]
pub fn mutate_entries_without_validation(
&mut self,
actions: BTreeMap<Vec<u8>, EntryAction>
)
Mutates entries without performing any validation.
For updates and deletes, the mutation is performed only if he entry version of the action is higher than the current version of the entry.
pub fn mutate_entry_without_validation(
&mut self,
key: Vec<u8>,
value: Value
) -> bool
[src]
pub fn mutate_entry_without_validation(
&mut self,
key: Vec<u8>,
value: Value
) -> bool
Mutates single entry without performing any validations, except the version check (new version must be higher than the existing one). If the entry doesn't exist yet, inserts it, otherwise, updates it. Returns true if the version check passed and the entry was mutated, false otherwise.
pub fn permissions(&self) -> &BTreeMap<User, PermissionSet>
[src]
pub fn permissions(&self) -> &BTreeMap<User, PermissionSet>
Gets a complete list of permissions
pub fn user_permissions(
&self,
user: &User
) -> Result<&PermissionSet, ClientError>
[src]
pub fn user_permissions(
&self,
user: &User
) -> Result<&PermissionSet, ClientError>
Gets a list of permissions for the provided user.
pub fn set_user_permissions(
&mut self,
user: User,
permissions: PermissionSet,
version: u64,
requester: PublicKey
) -> Result<(), ClientError>
[src]
pub fn set_user_permissions(
&mut self,
user: User,
permissions: PermissionSet,
version: u64,
requester: PublicKey
) -> Result<(), ClientError>
Insert or update permissions for the provided user.
pub fn set_user_permissions_without_validation(
&mut self,
user: User,
permissions: PermissionSet,
version: u64
) -> bool
[src]
pub fn set_user_permissions_without_validation(
&mut self,
user: User,
permissions: PermissionSet,
version: u64
) -> bool
Set user permission without performing any validation.
pub fn del_user_permissions(
&mut self,
user: &User,
version: u64,
requester: PublicKey
) -> Result<(), ClientError>
[src]
pub fn del_user_permissions(
&mut self,
user: &User,
version: u64,
requester: PublicKey
) -> Result<(), ClientError>
Delete permissions for the provided user.
pub fn del_user_permissions_without_validation(
&mut self,
user: &User,
version: u64
) -> bool
[src]
pub fn del_user_permissions_without_validation(
&mut self,
user: &User,
version: u64
) -> bool
Delete user permissions without performing any validation.
pub fn change_owner(
&mut self,
new_owner: PublicKey,
version: u64
) -> Result<(), ClientError>
[src]
pub fn change_owner(
&mut self,
new_owner: PublicKey,
version: u64
) -> Result<(), ClientError>
Change owner of the mutable data.
pub fn change_owner_without_validation(
&mut self,
new_owner: PublicKey,
version: u64
) -> bool
[src]
pub fn change_owner_without_validation(
&mut self,
new_owner: PublicKey,
version: u64
) -> bool
Change the owner without performing any validation.
pub fn serialised_size(&self) -> u64
[src]
pub fn serialised_size(&self) -> u64
Return the size of this data after serialisation.
pub fn validate_size(&self) -> bool
[src]
pub fn validate_size(&self) -> bool
Return true if the size is valid
Trait Implementations
impl Hash for MutableData
[src]
impl Hash for MutableData
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Eq for MutableData
[src]
impl Eq for MutableData
impl PartialEq for MutableData
[src]
impl PartialEq for MutableData
fn eq(&self, other: &MutableData) -> bool
[src]
fn eq(&self, other: &MutableData) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &MutableData) -> bool
[src]
fn ne(&self, other: &MutableData) -> bool
This method tests for !=
.
impl PartialOrd for MutableData
[src]
impl PartialOrd for MutableData
fn partial_cmp(&self, other: &MutableData) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &MutableData) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &MutableData) -> bool
[src]
fn lt(&self, other: &MutableData) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &MutableData) -> bool
[src]
fn le(&self, other: &MutableData) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &MutableData) -> bool
[src]
fn gt(&self, other: &MutableData) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &MutableData) -> bool
[src]
fn ge(&self, other: &MutableData) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for MutableData
[src]
impl Ord for MutableData
fn cmp(&self, other: &MutableData) -> Ordering
[src]
fn cmp(&self, other: &MutableData) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl Clone for MutableData
[src]
impl Clone for MutableData
fn clone(&self) -> MutableData
[src]
fn clone(&self) -> MutableData
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for MutableData
[src]
impl Debug for MutableData
Auto Trait Implementations
impl Send for MutableData
impl Send for MutableData
impl Sync for MutableData
impl Sync for MutableData