logo
pub struct Register { /* private fields */ }
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 true if public.

Return true if private.

Return the address.

Return the scope.

Return the name.

Return the tag.

Return the owner of the data.

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

Return the max number of items that can be held in the register.

Return the number of items held in the register

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.

Return user permissions, if applicable.

Return the policy.

Increment the size cap of the register, returning the previous value.

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.

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.

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

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

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)

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.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more