pub struct CanonicalVote {
pub vote_type: Type,
pub height: Height,
pub round: Round,
pub block_id: Option<Id>,
pub timestamp: Option<Time>,
pub chain_id: Id,
}
Expand description
CanonicalVote is used for protobuf encoding a Vote
Fields§
§vote_type: Type
Type of vote (prevote or precommit)
height: Height
Block height
round: Round
Round
block_id: Option<Id>
Block ID
timestamp: Option<Time>
Timestamp
chain_id: Id
Chain ID
Implementations§
Source§impl CanonicalVote
impl CanonicalVote
Sourcepub fn new(vote: Vote, chain_id: ChainId) -> CanonicalVote
pub fn new(vote: Vote, chain_id: ChainId) -> CanonicalVote
Create CanonicalVote from Vote
Trait Implementations§
Source§impl Clone for CanonicalVote
impl Clone for CanonicalVote
Source§fn clone(&self) -> CanonicalVote
fn clone(&self) -> CanonicalVote
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for CanonicalVote
impl Debug for CanonicalVote
Source§impl<'de> Deserialize<'de> for CanonicalVote
impl<'de> Deserialize<'de> for CanonicalVote
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 From<CanonicalVote> for CanonicalVote
impl From<CanonicalVote> for CanonicalVote
Source§fn from(value: CanonicalVote) -> Self
fn from(value: CanonicalVote) -> Self
Converts to this type from the input type.
Source§impl From<CanonicalVote> for CanonicalVote
impl From<CanonicalVote> for CanonicalVote
Source§fn from(value: CanonicalVote) -> Self
fn from(value: CanonicalVote) -> Self
Converts to this type from the input type.
Source§impl From<CanonicalVote> for CanonicalVote
impl From<CanonicalVote> for CanonicalVote
Source§fn from(value: CanonicalVote) -> Self
fn from(value: CanonicalVote) -> Self
Converts to this type from the input type.
Source§impl PartialEq for CanonicalVote
impl PartialEq for CanonicalVote
Source§impl Protobuf<CanonicalVote> for CanonicalVote
impl Protobuf<CanonicalVote> for CanonicalVote
§fn encode<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
fn encode<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
Encode into a buffer in Protobuf format. Read more
§fn encode_length_delimited<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
fn encode_length_delimited<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
Encode with a length-delimiter to a buffer in Protobuf format. Read more
§fn decode<B>(buf: B) -> Result<Self, Error>where
B: Buf,
fn decode<B>(buf: B) -> Result<Self, Error>where
B: Buf,
Constructor that attempts to decode an instance from a buffer. Read more
§fn decode_length_delimited<B>(buf: B) -> Result<Self, Error>where
B: Buf,
fn decode_length_delimited<B>(buf: B) -> Result<Self, Error>where
B: Buf,
Constructor that attempts to decode a length-delimited instance from
the buffer. Read more
§fn encoded_len(self) -> usize
fn encoded_len(self) -> usize
Returns the encoded length of the message without a length delimiter. Read more
§fn encode_vec(self) -> Vec<u8> ⓘ
fn encode_vec(self) -> Vec<u8> ⓘ
Encodes into a Protobuf-encoded
Vec<u8>
.§fn decode_vec(v: &[u8]) -> Result<Self, Error>
fn decode_vec(v: &[u8]) -> Result<Self, Error>
Constructor that attempts to decode a Protobuf-encoded instance from a
Vec<u8>
(or equivalent).§fn encode_length_delimited_vec(self) -> Vec<u8> ⓘ
fn encode_length_delimited_vec(self) -> Vec<u8> ⓘ
Encode with a length-delimiter to a
Vec<u8>
Protobuf-encoded message.§fn decode_length_delimited_vec(v: &[u8]) -> Result<Self, Error>
fn decode_length_delimited_vec(v: &[u8]) -> Result<Self, Error>
Constructor that attempts to decode a Protobuf-encoded instance with a
length-delimiter from a
Vec<u8>
or equivalent.Source§impl Protobuf<CanonicalVote> for CanonicalVote
impl Protobuf<CanonicalVote> for CanonicalVote
§fn encode<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
fn encode<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
Encode into a buffer in Protobuf format. Read more
§fn encode_length_delimited<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
fn encode_length_delimited<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
Encode with a length-delimiter to a buffer in Protobuf format. Read more
§fn decode<B>(buf: B) -> Result<Self, Error>where
B: Buf,
fn decode<B>(buf: B) -> Result<Self, Error>where
B: Buf,
Constructor that attempts to decode an instance from a buffer. Read more
§fn decode_length_delimited<B>(buf: B) -> Result<Self, Error>where
B: Buf,
fn decode_length_delimited<B>(buf: B) -> Result<Self, Error>where
B: Buf,
Constructor that attempts to decode a length-delimited instance from
the buffer. Read more
§fn encoded_len(self) -> usize
fn encoded_len(self) -> usize
Returns the encoded length of the message without a length delimiter. Read more
§fn encode_vec(self) -> Vec<u8> ⓘ
fn encode_vec(self) -> Vec<u8> ⓘ
Encodes into a Protobuf-encoded
Vec<u8>
.§fn decode_vec(v: &[u8]) -> Result<Self, Error>
fn decode_vec(v: &[u8]) -> Result<Self, Error>
Constructor that attempts to decode a Protobuf-encoded instance from a
Vec<u8>
(or equivalent).§fn encode_length_delimited_vec(self) -> Vec<u8> ⓘ
fn encode_length_delimited_vec(self) -> Vec<u8> ⓘ
Encode with a length-delimiter to a
Vec<u8>
Protobuf-encoded message.§fn decode_length_delimited_vec(v: &[u8]) -> Result<Self, Error>
fn decode_length_delimited_vec(v: &[u8]) -> Result<Self, Error>
Constructor that attempts to decode a Protobuf-encoded instance with a
length-delimiter from a
Vec<u8>
or equivalent.Source§impl Protobuf<CanonicalVote> for CanonicalVote
impl Protobuf<CanonicalVote> for CanonicalVote
§fn encode<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
fn encode<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
Encode into a buffer in Protobuf format. Read more
§fn encode_length_delimited<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
fn encode_length_delimited<B>(self, buf: &mut B) -> Result<(), Error>where
B: BufMut,
Encode with a length-delimiter to a buffer in Protobuf format. Read more
§fn decode<B>(buf: B) -> Result<Self, Error>where
B: Buf,
fn decode<B>(buf: B) -> Result<Self, Error>where
B: Buf,
Constructor that attempts to decode an instance from a buffer. Read more
§fn decode_length_delimited<B>(buf: B) -> Result<Self, Error>where
B: Buf,
fn decode_length_delimited<B>(buf: B) -> Result<Self, Error>where
B: Buf,
Constructor that attempts to decode a length-delimited instance from
the buffer. Read more
§fn encoded_len(self) -> usize
fn encoded_len(self) -> usize
Returns the encoded length of the message without a length delimiter. Read more
§fn encode_vec(self) -> Vec<u8> ⓘ
fn encode_vec(self) -> Vec<u8> ⓘ
Encodes into a Protobuf-encoded
Vec<u8>
.§fn decode_vec(v: &[u8]) -> Result<Self, Error>
fn decode_vec(v: &[u8]) -> Result<Self, Error>
Constructor that attempts to decode a Protobuf-encoded instance from a
Vec<u8>
(or equivalent).§fn encode_length_delimited_vec(self) -> Vec<u8> ⓘ
fn encode_length_delimited_vec(self) -> Vec<u8> ⓘ
Encode with a length-delimiter to a
Vec<u8>
Protobuf-encoded message.§fn decode_length_delimited_vec(v: &[u8]) -> Result<Self, Error>
fn decode_length_delimited_vec(v: &[u8]) -> Result<Self, Error>
Constructor that attempts to decode a Protobuf-encoded instance with a
length-delimiter from a
Vec<u8>
or equivalent.Source§impl Serialize for CanonicalVote
impl Serialize for CanonicalVote
Source§impl TryFrom<CanonicalVote> for CanonicalVote
impl TryFrom<CanonicalVote> for CanonicalVote
Source§impl TryFrom<CanonicalVote> for CanonicalVote
impl TryFrom<CanonicalVote> for CanonicalVote
Source§impl TryFrom<CanonicalVote> for CanonicalVote
impl TryFrom<CanonicalVote> for CanonicalVote
impl Eq for CanonicalVote
impl StructuralPartialEq for CanonicalVote
Auto Trait Implementations§
impl Freeze for CanonicalVote
impl RefUnwindSafe for CanonicalVote
impl Send for CanonicalVote
impl Sync for CanonicalVote
impl Unpin for CanonicalVote
impl UnwindSafe for CanonicalVote
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