Struct routing::PrivAppendableData [] [src]

pub struct PrivAppendableData {
    pub name: XorName,
    pub version: u64,
    pub filter: Filter,
    pub encrypt_key: PublicKey,
    pub deleted_data: BTreeSet<PrivAppendedData>,
    pub owners: BTreeSet<PublicKey>,
    pub signatures: BTreeMap<PublicKey, Signature>,
    pub data: BTreeSet<PrivAppendedData>,
}

Private appendable data.

These types may be stored unsigned with previous and current owner keys set to the same keys. Updates require a signature to validate.

Data can be appended by any key that is not excluded by the filter.

Fields

The name of this data chunk.

The version, i.e. the number of times this has been updated by a Post request.

The filter defining who is allowed to append items.

The key to use for encrypting appended data items.

A collection of previously deleted data items.

The pub_keys of the current owners of the chunk's.

The pub_keys and signatures of the owners of the chunk's current version.

The collection of appended data items. These are not signed by the owners, as they change even between Posts.

Methods

impl PrivAppendableData
[src]

Creates a new PubAppendableData signed with signing_key.

Updates this data item with the given updated version if the update is valid, otherwise returns an error.

This allows types to be created and previous_owner_signatures added one by one. To transfer ownership, the current owner signs over the data; the previous owners field must have the previous owners of version - 1 as the current owners of that last version.

The data will contain the union of the data items, excluding the deleted_data as given in the update.

Verifies that other is a valid update for self; returns an error otherwise.

An update is valid if it doesn't change the name, increases the version by 1 and is signed by (more than 50% of) the owners.

In case of an ownership transfer, the other's signatures are from owners in self.

Inserts the given data item, or returns false if it cannot be added because it has recently been deleted.

Inserts the given wrapper item, or returns false if cannot

Returns the name.

Returns DataIdentifier for this data element.

Adds a signature with the given keys.1 to the signatures and returns the number of signatures that are still required. If more than 50% of the owners have signed, 0 is returned and validation is complete.

Overwrite any existing signatures with the new signatures provided.

Get the data

Get the version

Get the current owner keys

Get previous owner signatures

Return true if the size is valid

Trait Implementations

impl Hash for PrivAppendableData
[src]

Feeds this value into the given [Hasher]. Read more

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

impl Eq for PrivAppendableData
[src]

impl PartialEq for PrivAppendableData
[src]

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

This method tests for !=.

impl PartialOrd for PrivAppendableData
[src]

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

impl Ord for PrivAppendableData
[src]

This method returns an Ordering between self and other. Read more

impl Clone for PrivAppendableData
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for PrivAppendableData
[src]

Formats the value using the given formatter.