pub trait Serialize: Size {
// Required method
fn tls_serialize<W: Write>(&self, writer: &mut W) -> Result<usize, Error>;
// Provided method
fn tls_serialize_detached(&self) -> Result<Vec<u8>, Error> { ... }
}Expand description
The Serialize trait provides functions to serialize a struct or enum.
The trait provides two functions:
tls_serializethat takes a buffer to write the serialization totls_serialize_detachedthat returns a byte vector
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl<T> Serialize for PhantomData<T>
impl<T> Serialize for PhantomData<T>
Implementors§
impl Serialize for &TlsByteVecU8
impl Serialize for &TlsByteVecU16
impl Serialize for &TlsByteVecU24
impl Serialize for &TlsByteVecU32
impl Serialize for &U24
impl Serialize for &VLByteSlice<'_>
Available on crate feature
std only.impl Serialize for &VLByteVec
Available on crate feature
std only.impl Serialize for &VLBytes
Available on crate feature
std only.impl Serialize for SecretVLByteVec
Available on crate feature
std only.impl Serialize for SecretVLBytes
Available on crate feature
std only.impl Serialize for TlsByteVecU8
impl Serialize for TlsByteVecU16
impl Serialize for TlsByteVecU24
impl Serialize for TlsByteVecU32
impl Serialize for TlsVarInt
impl Serialize for U24
impl Serialize for VLByteSlice<'_>
Available on crate feature
std only.impl Serialize for VLByteVec
Available on crate feature
std only.impl Serialize for VLBytes
Available on crate feature
std only.