Trait holochain::prelude::kitsune_p2p::dependencies::kitsune_p2p_types::dependencies::rustls::internal::msgs::codec::Codec
pub trait Codec: Debug + Sized {
fn encode(&self, bytes: &mut Vec<u8, Global>);
fn read(_: &mut Reader<'_>) -> Option<Self>;
fn get_encoding(&self) -> Vec<u8, Global> ⓘ { ... }
fn read_bytes(bytes: &[u8]) -> Option<Self> { ... }
}
Expand description
Trait for implementing encoding and decoding functionality on something.
Required Methods
Provided Methods
fn get_encoding(&self) -> Vec<u8, Global> ⓘ
fn get_encoding(&self) -> Vec<u8, Global> ⓘ
Convenience function for encoding the implementation into a vec and returning it
fn read_bytes(bytes: &[u8]) -> Option<Self>
fn read_bytes(bytes: &[u8]) -> Option<Self>
Function for wrapping a call to the read function in a Reader for the slice of bytes provided