Trait tls_codec::DeserializeBytes
source · pub trait DeserializeBytes: Size {
// Required method
fn tls_deserialize(bytes: &[u8]) -> Result<(Self, &[u8]), Error>
where Self: Sized;
// Provided method
fn tls_deserialize_exact(bytes: &[u8]) -> Result<Self, Error>
where Self: Sized { ... }
}
Required Methods§
sourcefn tls_deserialize(bytes: &[u8]) -> Result<(Self, &[u8]), Error>where
Self: Sized,
fn tls_deserialize(bytes: &[u8]) -> Result<(Self, &[u8]), Error>where Self: Sized,
This function deserializes the bytes
from the provided a &[u8]
and returns the populated struct, as well as the remaining slice.
In order to get the amount of bytes read, use Size::tls_serialized_len
.
Returns an error if one occurs during deserialization.
Provided Methods§
Implementations on Foreign Types§
source§impl DeserializeBytes for ()
impl DeserializeBytes for ()
source§impl<T> DeserializeBytes for PhantomData<T>
impl<T> DeserializeBytes for PhantomData<T>
source§impl<T: DeserializeBytes> DeserializeBytes for Option<T>
impl<T: DeserializeBytes> DeserializeBytes for Option<T>
source§impl<T: DeserializeBytes> DeserializeBytes for Vec<T>
impl<T: DeserializeBytes> DeserializeBytes for Vec<T>
source§impl DeserializeBytes for u16
impl DeserializeBytes for u16
source§impl DeserializeBytes for u32
impl DeserializeBytes for u32
source§impl DeserializeBytes for u8
impl DeserializeBytes for u8
source§impl<T, U, V> DeserializeBytes for (T, U, V)where
T: DeserializeBytes,
U: DeserializeBytes,
V: DeserializeBytes,
impl<T, U, V> DeserializeBytes for (T, U, V)where T: DeserializeBytes, U: DeserializeBytes, V: DeserializeBytes,
source§impl DeserializeBytes for u64
impl DeserializeBytes for u64
source§impl<T, U> DeserializeBytes for (T, U)where
T: DeserializeBytes,
U: DeserializeBytes,
impl<T, U> DeserializeBytes for (T, U)where T: DeserializeBytes, U: DeserializeBytes,
Implementors§
impl DeserializeBytes for SecretVLBytes
Available on crate feature
std
only.