[][src]Struct hypercore::Feed

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

Append-only log structure.

Methods

impl<T> Feed<T> where
    T: RandomAccess<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.

Return the Nodes which prove the correctness for the Node at index with a digest.

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.

Audit all data in the feed. Checks that all current data matches the hashes in the merkle tree, and clears the bitfield if not. The tuple returns is (valid_blocks, invalid_blocks)

(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<RandomAccessDisk>
[src]

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

Trait Implementations

impl Default for Feed<RandomAccessMemory>
[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.

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

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

Auto Trait Implementations

impl<T> !Send for Feed<T>

impl<T> !Sync for Feed<T>

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Clear for T where
    T: InitializableFromZeroed + ?Sized

impl<T> InitializableFromZeroed for T where
    T: Default

impl<T> Same for T

Should always be Self