Trait object::write::WritableBuffer [−][src]
pub trait WritableBuffer {
fn len(&self) -> usize;
fn reserve(&mut self, additional: usize) -> Result<(), ()>;
fn resize(&mut self, new_len: usize, value: u8);
fn write_bytes(&mut self, val: &[u8]);
fn write_pod<T: Pod>(&mut self, val: &T)
where
Self: Sized,
{ ... }
fn write_pod_slice<T: Pod>(&mut self, val: &[T])
where
Self: Sized,
{ ... }
}
Expand description
Trait for writable buffer.
Required methods
Reserves specified number of bytes in the buffer.
Writes the specified value at the end of the buffer until the buffer has the specified length.
fn write_bytes(&mut self, val: &[u8])
fn write_bytes(&mut self, val: &[u8])
Writes the specified slice of bytes at the end of the buffer.
Provided methods
Writes the specified Pod
type at the end of the buffer.
fn write_pod_slice<T: Pod>(&mut self, val: &[T]) where
Self: Sized,
fn write_pod_slice<T: Pod>(&mut self, val: &[T]) where
Self: Sized,
Writes the specified Pod
slice at the end of the buffer.