Trait nuts_bytes::PutBytes
source · pub trait PutBytes {
// Required method
fn put_bytes(&mut self, buf: &[u8]) -> Result<()>;
}
Expand description
Trait that describes a writer of binary data.
The Writer
utility accepts all types that implements this trait.
Required Methods§
Implementations on Foreign Types§
source§impl PutBytes for &mut [u8]
impl PutBytes for &mut [u8]
PutBytes
is implemented for &mut [u8]
by copying into the slice,
overwriting its data.
Note that putting bytes updates the slice to point to the yet unwritten part. The slice will be empty when it has been completely overwritten.
If the number of bytes to be written exceeds the size of the slice, the
operation will return an Error::NoSpace
error.