pub trait FromBytes {
type Error;
// Required method
fn from_bytes(_: &[u8]) -> Result<&Self, Self::Error>;
}
Expand description
A cheap conversion from a byte slice to typed data.
Given a reference to a byte slice, returns a different view of the same
data. No allocation is performed, however the underlying data might be
checked for correctness (for example when converting to str
).
See also the ToBytes
trait.
Required Associated Types§
Required Methods§
Object Safety§
This trait is not object safe.