Struct sn_data_types::register::Register[][src]

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

Object storing the Register

Implementations

Construct a new Public Register. The ‘authority’ is assumed to be the PK which the messages were and will be signed with. 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.

Construct a new Private Register. The ‘authority’ is assumed to be the PK which the messages were and will be signed with. 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.

Return the address.

Return the kind.

Return the name.

Return the tag.

Return true if public.

Return true if private.

Return the number of items held in the register, optionally verifying read permissions if a pk is provided

Return true if the register is empty.

Return a value corresponding to the provided ‘hash’, if present.

Read the last entry, or entries when there are branches, if the register is not empty.

Write an entry to the Register, returning the generated unsigned CRDT operation so the caller can sign and broadcast it to other replicas, along with the hash of the entry just written.

Apply a signed data CRDT operation.

Return user permissions, if applicable.

Return the policy.

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.

Return the owner of the data.

Return 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 !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

Serialize this value into the given Serde serializer. Read more

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

Performs the conversion.

Performs the conversion.

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.