Struct hypercore::Feed[][src]

pub struct Feed<T> where
    T: RandomAccessMethods<Error = Error> + Debug
{ /* fields omitted */ }

Append-only log structure.

Methods

impl<T> Feed<T> where
    T: RandomAccessMethods<Error = Error> + Debug
[src]

Create a new instance with a custom storage backend.

Starts a FeedBuilder with the provided Keypair and Storage.

Get the amount of entries in the feed.

Check if the length is 0.

Get the total amount of bytes stored in the feed.

Append data into the log.

Get the block of data at the tip of the feed. This will be the most recently appended block.

Return true if a data block is available locally.

Return true if all data blocks within a range are available locally.

Get the total amount of chunks downloaded.

Retrieve data from the log.

Return the Nodes which prove the correctness for the Node at index.

Compute the digest for the index.

Insert data into the tree at index. Verifies the proof when inserting to make sure data is correct. Useful when replicating data from a remote host.

Get a signature from the store.

Verify the entire feed. Checks a signature against the signature of all root nodes combined.

Announce we have a piece of data to all other peers.

Announce we no longer have a piece of data to all other peers.

Get all root hashes from the feed.

Access the public key.

Access the secret key.

(unimplemented) Provide a range of data to download.

(unimplemented) Provide a range of data to remove from the local storage.

(unimplemented) End the feed.

Update all peers.

impl Feed<RandomAccessDiskMethods>
[src]

Create a new instance that persists to disk at the location of dir.

Trait Implementations

impl<T: Debug> Debug for Feed<T> where
    T: RandomAccessMethods<Error = Error> + Debug
[src]

Formats the value using the given formatter. Read more

impl Default for Feed<RandomAccessMemoryMethods>
[src]

Create a new instance with an in-memory storage backend.

Panics

Can panic if constructing the in-memory store fails, which is highly unlikely.

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

impl<T: RandomAccessMethods<Error = Error> + Debug> Display for Feed<T>
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<T> !Send for Feed<T>

impl<T> !Sync for Feed<T>