[][src]Struct tendermint_testgen::commit::Commit

pub struct Commit {
    pub header: Option<Header>,
    pub votes: Option<Vec<Vote>>,
    pub round: Option<u32>,
}

Fields

header: Option<Header>votes: Option<Vec<Vote>>round: Option<u32>

Implementations

impl Commit[src]

pub fn new(header: Header, round: u32) -> Self[src]

Make a new commit using default votes produced from the header.

pub fn new_with_votes(header: Header, round: u32, votes: Vec<Vote>) -> Self[src]

Make a new commit using explicit votes.

pub fn header(self, header: Header) -> Self[src]

pub fn votes(self, votes: Vec<Vote>) -> Self[src]

pub fn round(self, round: u32) -> Self[src]

pub fn generate_default_votes(self) -> Self[src]

Generate commit votes from all validators in the header. This function will panic if the header is not present

pub fn vote_of_validator(&mut self, id: &str) -> &mut Vote[src]

Get a mutable reference to the vote of the given validator. This function will panic if the votes or the validator vote is not present

pub fn vote_at_index(&mut self, index: usize) -> &mut Vote[src]

Get a mutable reference to the vote at the given index This function will panic if the votes or the vote at index is not present

Trait Implementations

impl Clone for Commit[src]

impl Debug for Commit[src]

impl<'de> Deserialize<'de> for Commit[src]

impl FromStr for Commit[src]

type Err = SimpleError

The associated error which can be returned from parsing.

impl Generator<Commit> for Commit[src]

impl Options for Commit[src]

impl Serialize for Commit[src]

Auto Trait Implementations

impl RefUnwindSafe for Commit

impl Send for Commit

impl Sync for Commit

impl Unpin for Commit

impl UnwindSafe for Commit

Blanket Implementations

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

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

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

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

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

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,