Struct data_chain::data_chain::DataChain [] [src]

pub struct DataChain { /* fields omitted */ }

Created by holder of chain, can be passed to others as proof of data held. This object is verifiable if : The last validation contains the majority of current close group OR on network restart the nodes all must try and restart on previous names. They can continue any validation of the holder of a chain. This requires nodes to always restart as last ID and if there was no restart they are rejected at vault level. If there was a restart then the nodes should validate and continue. N:B this means all nodes can use a named directory for data store and clear if they restart as a new id. This allows clean-up of old data cache directories.

Methods

impl DataChain
[src]

[src]

Nodes always validate a chain before accepting it Validation takes place from start of chain to now. Also confirm we can accept this chain, by comparing our current group with the majority of the last known link This method will NOT purge

[src]

Add a nodeblock received from a peer Uses lazy accumulation If block becomes or is valid, then it is returned

[src]

find a block (user required to test for validity)

[src]

Extract slice containing entire chain

[src]

Extract mutable slice containing entire chain

[src]

Remove a block, will ignore Links

[src]

Clear chain

[src]

Check if chain contains a particular identifier

[src]

Return position of block identifier

[src]

Inserts an element at position index within the chain, shifting all elements after it to the right. Will not validate this block!

Panics

Panics if index is greater than the chains's length.

[src]

Returns an iterator over subslices separated by elements that match pred. The matched element is not contained in the subslices.

[src]

Returns an iterator over subslices separated by elements that match pred. The matched element is not contained in the subslices.

[src]

Returns an iterator over subslices separated by elements that match pred, limited to returning at most n items. The matched element is not contained in the subslices. The last element returned, if any, will contain the remainder of the slice.

[src]

Returns an iterator over subslices separated by elements that match pred, limited to returning at most n items. The matched element is not contained in the subslices. The last element returned, if any, will contain the remainder of the slice.

[src]

Splits the chain into two at the given index. Returns a newly allocated Self. chain contains elements [0, at), and the returned chain contains elements [at, len). Note that the capacity of chain does not change.]]

[src]

Returns an iterator over subslices separated by elements that match pred limited to returning at most n items. This starts at the end of the slice and works backwards. The matched element is not contained in the subslices. The last element returned, if any, will contain the remainder of the slice.

[src]

Returns an iterator over subslices separated by elements that match pred limited to returning at most n items. This starts at the end of the slice and works backwards. The matched element is not contained in the subslices. The last element returned, if any, will contain the remainder of the slice.

[src]

Validate an individual block. Will get latest link and confirm all signatures were from last known valid group.

[src]

Remove all invalid blocks, does not confirm chain is valid to this group.

[src]

Total length of chain

[src]

Number of valid blocks

[src]

number of blocks

number of links

[src]

Contains no blocks that are not valid

Return all links in chain Does not perform validation on links

Validate and return all links in chain

[src]

Mark all links that are valid as such.

Trait Implementations

impl Default for DataChain
[src]

[src]

Returns the "default value" for a type. Read more

impl Debug for DataChain
[src]

[src]

Formats the value using the given formatter. Read more

impl PartialEq for DataChain
[src]

[src]

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

[src]

This method tests for !=.

impl Encodable for DataChain
[src]

[src]

Serialize a value using an Encoder.

impl Decodable for DataChain
[src]

[src]

Deserialize a value using a Decoder.

Auto Trait Implementations

impl Send for DataChain

impl Sync for DataChain