Trait plain::Methods
[−]
[src]
pub trait Methods: Plain { fn from_bytes<'a>(bytes: &'a [u8]) -> Result<&'a Self, Error>; fn from_mut_bytes<'a>(bytes: &'a mut [u8]) -> Result<&'a mut Self, Error>; fn as_bytes(&self) -> &[u8] { ... } fn as_mut_bytes(&mut self) -> &mut [u8] { ... } }
This trait exposes all the functionality of this crate as methods on applicable types.
It is implemented automatically for every type marked with
the Plain trait, as well as their slices,
so you should never need to implement it yourself.
Required Methods
fn from_bytes<'a>(bytes: &'a [u8]) -> Result<&'a Self, Error>
Same as from_bytes(), except attached to T.
fn from_mut_bytes<'a>(bytes: &'a mut [u8]) -> Result<&'a mut Self, Error>
Same as from_mut_bytes(), except attached to T.
Provided Methods
fn as_bytes(&self) -> &[u8]
Same as as_bytes(), except as a method of T.
fn as_mut_bytes(&mut self) -> &mut [u8]
Same as as_mut_bytes(), except as a method of T.