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