[−][src]Struct sn_data_types::SeqMap
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
impl SeqData
[src]
pub fn address(&self) -> &Address
[src]
Returns the address.
pub fn name(&self) -> &XorName
[src]
Returns the name.
pub fn tag(&self) -> u64
[src]
Returns the tag type.
pub fn kind(&self) -> Kind
[src]
Returns the kind.
pub fn version(&self) -> u64
[src]
Returns the version of the Map fields (not the data version).
pub fn owner(&self) -> &PublicKey
[src]
Returns the owner key.
pub fn keys(&self) -> BTreeSet<Vec<u8>>
[src]
Returns all the keys in the data.
pub fn shell(&self) -> Self
[src]
Returns the shell of this Map (the fields without the data).
pub fn permissions(&self) -> BTreeMap<PublicKey, PermissionSet>
[src]
Gets a complete list of permissions.
pub fn user_permissions(&self, user: PublicKey) -> Result<&PermissionSet>
[src]
Gets the permissions for the provided user.
pub fn check_is_owner(&self, requester: PublicKey) -> Result<()>
[src]
Checks if the provided user is an owner.
Returns Ok(())
on success and Err(Error::AccessDenied)
if the user is not an
owner.
pub fn check_permissions(
&self,
action: Action,
requester: PublicKey
) -> Result<()>
[src]
&self,
action: Action,
requester: PublicKey
) -> Result<()>
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<()>
[src]
&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.
pub fn del_user_permissions(
&mut self,
user: PublicKey,
version: u64
) -> Result<()>
[src]
&mut self,
user: PublicKey,
version: u64
) -> Result<()>
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
[src]
&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.
pub fn change_owner(&mut self, new_owner: PublicKey, version: u64) -> Result<()>
[src]
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.
pub fn change_owner_without_validation(
&mut self,
new_owner: PublicKey,
version: u64
) -> bool
[src]
&mut self,
new_owner: PublicKey,
version: u64
) -> bool
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.
pub fn is_action_allowed(&self, requester: &PublicKey, action: Action) -> bool
[src]
Returns true if action
is allowed for the provided user.
impl SeqData
[src]
Implements functions for sequenced Map.
pub fn new(name: XorName, tag: u64, owner: PublicKey) -> Self
[src]
Creates a new sequenced Map.
pub fn new_with_data(
name: XorName,
tag: u64,
data: SeqEntries,
permissions: BTreeMap<PublicKey, PermissionSet>,
owner: PublicKey
) -> Self
[src]
name: XorName,
tag: u64,
data: SeqEntries,
permissions: BTreeMap<PublicKey, PermissionSet>,
owner: PublicKey
) -> Self
Creates a new sequenced Map with entries and permissions.
pub fn get(&self, key: &[u8]) -> Option<&SeqValue>
[src]
Returns a value by the given key
pub fn values(&self) -> Vec<SeqValue>
[src]
Returns values of all entries
pub fn entries(&self) -> &SeqEntries
[src]
Returns all entries
pub fn take_entries(&mut self) -> SeqEntries
[src]
Removes and returns all entries
pub fn mutate_entries(
&mut self,
actions: SeqEntryActions,
requester: PublicKey
) -> Result<()>
[src]
&mut self,
actions: SeqEntryActions,
requester: PublicKey
) -> Result<()>
Mutates entries (key + value pairs) in bulk.
Returns Err(InvalidEntryActions)
if the mutation parameters are invalid.
Trait Implementations
impl Clone for SeqData
[src]
impl Debug for SeqData
[src]
impl<'de> Deserialize<'de> for SeqData
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for SeqData
[src]
impl From<SeqData> for Data
[src]
impl Hash for SeqData
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for SeqData
[src]
fn cmp(&self, other: &SeqData) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<SeqData> for SeqData
[src]
impl PartialOrd<SeqData> for SeqData
[src]
fn partial_cmp(&self, other: &SeqData) -> Option<Ordering>
[src]
fn lt(&self, other: &SeqData) -> bool
[src]
fn le(&self, other: &SeqData) -> bool
[src]
fn gt(&self, other: &SeqData) -> bool
[src]
fn ge(&self, other: &SeqData) -> bool
[src]
impl Serialize for SeqData
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for SeqData
[src]
impl StructuralPartialEq for SeqData
[src]
Auto Trait Implementations
impl RefUnwindSafe for SeqData
impl Send for SeqData
impl Sync for SeqData
impl Unpin for SeqData
impl UnwindSafe for SeqData
Blanket Implementations
impl<A> Actor for A where
A: Clone + Ord + Hash,
[src]
A: Clone + Ord + Hash,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Member for T where
T: Clone + Eq + Hash,
[src]
T: Clone + Eq + Hash,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,