Enum tendermint_p2p::secret_connection::Version
source · pub enum Version {
V0_34,
V0_33,
Legacy,
}
Expand description
Protocol version (based on the Tendermint version)
Variants§
Implementations§
source§impl Version
impl Version
sourcepub fn has_transcript(self) -> bool
pub fn has_transcript(self) -> bool
Does this version of Secret Connection use a transcript hash
sourcepub const fn is_protobuf(self) -> bool
pub const fn is_protobuf(self) -> bool
Are messages encoded using Protocol Buffers?
sourcepub fn encode_initial_handshake(self, eph_pubkey: &EphemeralPublic) -> Vec<u8>
pub fn encode_initial_handshake(self, eph_pubkey: &EphemeralPublic) -> Vec<u8>
Encode the initial handshake message (i.e. first one sent by both peers)
sourcepub fn decode_initial_handshake(
self,
bytes: &[u8]
) -> Result<EphemeralPublic, Error>
pub fn decode_initial_handshake( self, bytes: &[u8] ) -> Result<EphemeralPublic, Error>
sourcepub fn encode_auth_signature(
self,
pub_key: &VerificationKey,
signature: &Signature
) -> Vec<u8>
pub fn encode_auth_signature( self, pub_key: &VerificationKey, signature: &Signature ) -> Vec<u8>
Encode signature which authenticates the handshake
§Panics
Panics if the Protobuf encoding of AuthSigMessage
fails
sourcepub const fn auth_sig_msg_response_len(self) -> usize
pub const fn auth_sig_msg_response_len(self) -> usize
Get the length of the auth message response for this protocol version
sourcepub fn decode_auth_signature(
self,
bytes: &[u8]
) -> Result<AuthSigMessage, Error>
pub fn decode_auth_signature( self, bytes: &[u8] ) -> Result<AuthSigMessage, Error>
Decode signature message which authenticates the handshake
§Errors
- if the decoding of the bytes fails
Trait Implementations§
source§impl Ord for Version
impl Ord for Version
source§impl PartialEq for Version
impl PartialEq for Version
source§impl PartialOrd for Version
impl PartialOrd for Version
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Version
impl Eq for Version
impl StructuralPartialEq for Version
Auto Trait Implementations§
impl Freeze for Version
impl RefUnwindSafe for Version
impl Send for Version
impl Sync for Version
impl Unpin for Version
impl UnwindSafe for Version
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