[−][src]Enum safe_nd::Sequence
Object storing a Sequence variant.
Variants
Public(PubSeqData)
Public Sequence Data.
Private(PrivSeqData)
Private Sequence Data.
Implementations
impl Data
[src]
pub fn new_pub(actor: PublicKey, name: XorName, tag: u64) -> Self
[src]
Constructs a new Public Sequence Data.
pub fn new_private(actor: PublicKey, name: XorName, tag: u64) -> Self
[src]
Constructs a new Private Sequence Data.
pub fn address(&self) -> &Address
[src]
Returns the address.
pub fn kind(&self) -> Kind
[src]
Returns the kind.
pub fn name(&self) -> &XorName
[src]
Returns the name.
pub fn tag(&self) -> u64
[src]
Returns the tag.
pub fn is_pub(&self) -> bool
[src]
Returns true
if public.
pub fn is_private(&self) -> bool
[src]
Returns true
if private.
pub fn check_permission(
&self,
action: Action,
requester: PublicKey
) -> Result<()>
[src]
&self,
action: Action,
requester: PublicKey
) -> Result<()>
Checks permissions for given action
for the provided user.
Returns:
Ok(())
if the permissions are valid,
Err::InvalidOwners
if the last owner is invalid,
Err::AccessDenied
if the action is not allowed.
pub fn entries_index(&self) -> u64
[src]
Returns the last entry index.
pub fn permissions_index(&self) -> u64
[src]
Returns the last permissions index.
pub fn owners_index(&self) -> u64
[src]
Returns the last owners index.
pub fn in_range(&self, start: Index, end: Index) -> Option<Entries>
[src]
Gets a list of keys and values with the given indices.
pub fn get(&self, index: Index) -> Option<&Vec<u8>>
[src]
Returns a value at 'index', if present.
pub fn last_entry(&self) -> Option<&Entry>
[src]
Returns the last entry, if present.
pub fn owner(&self, owners_index: impl Into<Index>) -> Option<&Owner>
[src]
Fetches owner at index.
pub fn append(&mut self, entry: Entry) -> WriteOp<Entry>
[src]
Appends new entry.
pub fn apply_crdt_op(&mut self, op: Op<Entry, PublicKey>)
[src]
Apply CRDT operation.
pub fn set_pub_permissions(
&mut self,
permissions: BTreeMap<User, PubUserPermissions>
) -> Result<WriteOp<PublicPermissions>>
[src]
&mut self,
permissions: BTreeMap<User, PubUserPermissions>
) -> Result<WriteOp<PublicPermissions>>
a new permissions entry for Public Sequence.
pub fn set_private_permissions(
&mut self,
permissions: BTreeMap<PublicKey, PrivUserPermissions>
) -> Result<WriteOp<PrivatePermissions>>
[src]
&mut self,
permissions: BTreeMap<PublicKey, PrivUserPermissions>
) -> Result<WriteOp<PrivatePermissions>>
Adds a new permissions entry for Private Sequence.
pub fn apply_crdt_pub_perms_op(
&mut self,
op: Op<PublicPermissions, PublicKey>
) -> Result<()>
[src]
&mut self,
op: Op<PublicPermissions, PublicKey>
) -> Result<()>
Apply Public Permissions CRDT operation.
pub fn apply_crdt_private_perms_op(
&mut self,
op: Op<PrivatePermissions, PublicKey>
) -> Result<()>
[src]
&mut self,
op: Op<PrivatePermissions, PublicKey>
) -> Result<()>
Apply Private Permissions CRDT operation.
pub fn set_owner(&mut self, owner: PublicKey) -> WriteOp<Owner>
[src]
Adds a new owner entry.
pub fn apply_crdt_owner_op(&mut self, op: Op<Owner, PublicKey>)
[src]
Apply Owner CRDT operation.
pub fn check_is_last_owner(&self, requester: PublicKey) -> Result<()>
[src]
Checks if the requester is the last owner.
Returns:
Ok(())
if the requester is the owner,
Err::InvalidOwners
if the last owner is invalid,
Err::AccessDenied
if the requester is not the owner.
pub fn user_permissions(
&self,
user: User,
index: impl Into<Index>
) -> Result<UserPermissions>
[src]
&self,
user: User,
index: impl Into<Index>
) -> Result<UserPermissions>
Returns user permissions, if applicable.
pub fn pub_permissions(
&self,
index: impl Into<Index>
) -> Result<&PublicPermissions>
[src]
&self,
index: impl Into<Index>
) -> Result<&PublicPermissions>
Returns public permissions, if applicable.
pub fn private_permissions(
&self,
index: impl Into<Index>
) -> Result<&PrivatePermissions>
[src]
&self,
index: impl Into<Index>
) -> Result<&PrivatePermissions>
Returns private permissions, if applicable.
Trait Implementations
impl Clone for Data
[src]
impl Debug for Data
[src]
impl<'de> Deserialize<'de> for Data
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for Data
[src]
impl From<Data> for Data
[src]
impl Hash for Data
[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 PartialEq<Data> for Data
[src]
impl PartialOrd<Data> for Data
[src]
fn partial_cmp(&self, other: &Data) -> Option<Ordering>
[src]
fn lt(&self, other: &Data) -> bool
[src]
fn le(&self, other: &Data) -> bool
[src]
fn gt(&self, other: &Data) -> bool
[src]
fn ge(&self, other: &Data) -> bool
[src]
impl Serialize for Data
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for Data
[src]
impl StructuralPartialEq for Data
[src]
impl TryFrom<QueryResponse> for Sequence
[src]
type Error = TryFromError
The type returned in the event of a conversion error.
fn try_from(response: QueryResponse) -> Result<Self, Self::Error>
[src]
Auto Trait Implementations
impl RefUnwindSafe for Data
impl Send for Data
impl Sync for Data
impl Unpin for Data
impl UnwindSafe for Data
Blanket Implementations
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,
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.
fn to_owned(&self) -> T
[src]
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.
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.
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>,