pub(crate) trait FromBytes: Sized {
// Required method
fn from_bytes(b: &[u8], p: Pos) -> Result<Self>;
// Provided method
fn from_vec(v: Vec<u8>, p: Pos) -> Result<Self> { ... }
}Expand description
Describes a value that van be decoded from a bunch of bytes.
Used for decoding the objects between BEGIN and END tags.
Required Methods§
Sourcefn from_bytes(b: &[u8], p: Pos) -> Result<Self>
fn from_bytes(b: &[u8], p: Pos) -> Result<Self>
Try to parse a value of this type from a byte slice
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.