Struct safe_network::types::Sequence [−][src]
pub struct Sequence { /* fields omitted */ }
Expand description
Object storing the Sequence
Implementations
pub fn new_public(
authority: PublicKey,
actor: String,
name: XorName,
tag: u64,
policy: Option<PublicPolicy>
) -> Self
pub fn new_public(
authority: PublicKey,
actor: String,
name: XorName,
tag: u64,
policy: Option<PublicPolicy>
) -> Self
Constructs a new Public Sequence Data. The ‘authority’ is assumed to be the PK which the messages were and will be signed with, whilst the ‘actor’ is a unique identifier to be used as the clock’s Dot in all operations generated by this instance. If a policy is not provided, a default policy will be set where the ‘authority’ is the owner along with an empty users permissions set.
pub fn new_private(
authority: PublicKey,
actor: String,
name: XorName,
tag: u64,
policy: Option<PrivatePolicy>
) -> Self
pub fn new_private(
authority: PublicKey,
actor: String,
name: XorName,
tag: u64,
policy: Option<PrivatePolicy>
) -> Self
Constructs a new Private Sequence Data. The ‘authority’ is assumed to be the PK which the messages were and will be signed with, whilst the ‘actor’ is a unique identifier to be used as the clock’s Dot in all operations generated by this instance. If a policy is not provided, a default policy will be set where the ‘authority’ is the owner along with an empty users permissions set.
Returns true
if private.
Returns the length of the sequence, optionally verifying read permissions if a pk is provided
Returns true if the sequence is empty.
Gets a list of items which are within the given indices. Note the range of items is [start, end), i.e. the end index is not inclusive.
Returns a value at ‘index’, if present.
Returns the last entry, if it’s not empty.
Generate unsigned crdt op, adding the new entry.
Returns user permissions, if applicable.
Returns the public policy, if applicable.
Returns the private policy, if applicable.
Helper to check permissions for given action
for the given requester’s public key.
Returns:
Ok(())
if the permissions are valid,
Err::AccessDenied
if the action is not allowed.
Returns the PK which the messages are expected to be signed with by this replica.
Trait Implementations
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
type Error = TryFromError
type Error = TryFromError
The type returned in the event of a conversion error.
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for Data
impl UnwindSafe for Data
Blanket Implementations
Mutably borrows from an owned value. Read more
impl<T> CallHasher for T where
T: Hash,
impl<T> CallHasher for T where
T: Hash,
Compare self to key
and return true
if they are equal.
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
type Output = T
type Output = T
Should always be Self
pub fn vzip(self) -> V