[][src]Struct sn_data_types::UnseqMap

pub struct UnseqMap { /* fields omitted */ }

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 UnseqData[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]

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]

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]

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]

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]

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 UnseqData[src]

pub fn new(name: XorName, tag: u64, owner: PublicKey) -> Self[src]

Creates a new unsequenced Map.

pub fn new_with_data(
    name: XorName,
    tag: u64,
    data: UnseqEntries,
    permissions: BTreeMap<PublicKey, PermissionSet>,
    owner: PublicKey
) -> Self
[src]

Creates a new unsequenced Map with entries and permissions.

pub fn get(&self, key: &[u8]) -> Option<&Vec<u8>>[src]

Returns a value for the given key.

pub fn values(&self) -> Vec<Vec<u8>>[src]

Returns values of all entries.

pub fn entries(&self) -> &UnseqEntries[src]

Returns all entries.

pub fn take_entries(&mut self) -> UnseqEntries[src]

Removes and returns all entries.

pub fn mutate_entries(
    &mut self,
    actions: UnseqEntryActions,
    requester: PublicKey
) -> Result<()>
[src]

Mutates entries based on actions for the provided user.

Returns Err(InvalidEntryActions) if the mutation parameters are invalid.

Trait Implementations

impl Clone for UnseqData[src]

impl Debug for UnseqData[src]

impl<'de> Deserialize<'de> for UnseqData[src]

impl Eq for UnseqData[src]

impl From<UnseqData> for Data[src]

impl Hash for UnseqData[src]

impl Ord for UnseqData[src]

impl PartialEq<UnseqData> for UnseqData[src]

impl PartialOrd<UnseqData> for UnseqData[src]

impl Serialize for UnseqData[src]

impl StructuralEq for UnseqData[src]

impl StructuralPartialEq for UnseqData[src]

Auto Trait Implementations

Blanket Implementations

impl<A> Actor for A where
    A: Clone + Ord + Hash
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Member for T where
    T: Clone + Eq + Hash
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,