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

Same as from_bytes(), except attached to T.

Same as from_mut_bytes(), except attached to T.

Provided Methods

Same as as_bytes(), except as a method of T.

Same as as_mut_bytes(), except as a method of T.

Implementors