Struct safe_network::types::Sequence[][src]

pub struct Sequence { /* fields omitted */ }
Expand description

Object storing the Sequence

Implementations

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.

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 the address.

Returns the kind.

Returns the name.

Returns the tag.

Returns true if public.

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.

pub fn last_entry(&self, requester: Option<PublicKey>) -> Result<Option<&Entry>>

Returns the last entry, if it’s not empty.

Generate unsigned crdt op, adding the new entry.

Apply a signed data CRDT operation.

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 owner of the data.

Returns the PK which the messages are expected to be signed with by this replica.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Deserialize this value from the given Serde deserializer. Read more

Performs the conversion.

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Compare self to key and return true if they are equal.

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The alignment of pointer.

The type for initializers.

Initializes a with the given initializer. Read more

Dereferences the given pointer. Read more

Mutably dereferences the given pointer. Read more

Drops the object pointed to by the given pointer. Read more

Should always be Self

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.