Struct parsec::Block[][src]

pub struct Block<T: NetworkEvent, P: PublicId> { /* fields omitted */ }

A struct representing a collection of votes by peers for a network event of type T.

Methods

impl<T: NetworkEvent, P: PublicId> Block<T, P>
[src]

Creates a Block from payload and votes.

Returns the payload of this block.

Returns the proofs of this block.

Converts vote to a Proof and attempts to add it to the block. Returns an error if vote is invalid (i.e. signature check fails or the vote is for a different network event), Ok(true) if the Proof wasn't previously held in this Block, or Ok(false) if it was previously held.

Trait Implementations

impl<T: Clone + NetworkEvent, P: Clone + PublicId> Clone for Block<T, P>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<T: PartialEq + NetworkEvent, P: PartialEq + PublicId> PartialEq for Block<T, P>
[src]

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

This method tests for !=.

impl<T: Eq + NetworkEvent, P: Eq + PublicId> Eq for Block<T, P>
[src]

impl<T: PartialOrd + NetworkEvent, P: PartialOrd + PublicId> PartialOrd for Block<T, P>
[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<T: Ord + NetworkEvent, P: Ord + PublicId> Ord for Block<T, P>
[src]

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

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

impl<T: Debug + NetworkEvent, P: Debug + PublicId> Debug for Block<T, P>
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<T, P> Send for Block<T, P> where
    P: Send,
    T: Send,
    <P as PublicId>::Signature: Send

impl<T, P> Sync for Block<T, P> where
    P: Sync,
    T: Sync,
    <P as PublicId>::Signature: Sync