pub struct Vote<V, A> {
pub type: VoteType,
pub height: u64,
pub round: Round,
pub value: Option<V>,
pub validator_address: A,
}Expand description
A vote for a value in a consensus round.
A vote is cast by a validator to indicate their agreement or disagreement with a proposed block value. The vote includes the validator’s address, the round number, and the block value being voted on.
Fields§
§type: VoteTypeThe type of vote (Prevote or Precommit)
height: u64The blockchain height
round: RoundThe consensus round number
value: Option<V>The value being voted on (None for nil votes)
validator_address: AThe address of the validator casting the vote
Implementations§
Trait Implementations§
Source§impl<'de, V, A> Deserialize<'de> for Vote<V, A>where
V: Deserialize<'de>,
A: Deserialize<'de>,
impl<'de, V, A> Deserialize<'de> for Vote<V, A>where
V: Deserialize<'de>,
A: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<V: Ord, A: Ord> Ord for Vote<V, A>
impl<V: Ord, A: Ord> Ord for Vote<V, A>
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<V: PartialOrd, A: PartialOrd> PartialOrd for Vote<V, A>
impl<V: PartialOrd, A: PartialOrd> PartialOrd for Vote<V, A>
impl<V: Eq, A: Eq> Eq for Vote<V, A>
impl<V, A> StructuralPartialEq for Vote<V, A>
Auto Trait Implementations§
impl<V, A> Freeze for Vote<V, A>
impl<V, A> RefUnwindSafe for Vote<V, A>where
A: RefUnwindSafe,
V: RefUnwindSafe,
impl<V, A> Send for Vote<V, A>
impl<V, A> Sync for Vote<V, A>
impl<V, A> Unpin for Vote<V, A>
impl<V, A> UnwindSafe for Vote<V, A>where
A: UnwindSafe,
V: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more