Trait allsorts_no_std::binary::write::WriteContext [−][src]
Trait for types that can have binary data written to them.
Required methods
fn write_bytes(&mut self, data: &[u8]) -> Result<(), WriteError>
[src]
Write a slice of bytes to a WriteContext
.
fn write_zeros(&mut self, count: usize) -> Result<(), WriteError>
[src]
Write the specified number of zero bytes to the WriteContext
.
fn bytes_written(&self) -> usize
[src]
The total number of bytes written so far.
fn write_placeholder<T, HostType>(
&mut self,
placeholder: Placeholder<T, HostType>,
val: HostType
) -> Result<T::Output, WriteError> where
T: WriteBinary<HostType>,
[src]
&mut self,
placeholder: Placeholder<T, HostType>,
val: HostType
) -> Result<T::Output, WriteError> where
T: WriteBinary<HostType>,
Consumes the placeholder and writes the supplied value into it
Provided methods
fn write_array<'a, T>(
&mut self,
array: &ReadArray<'a, T>
) -> Result<(), WriteError> where
Self: Sized,
T: ReadUnchecked<'a> + WriteBinary<<T as ReadUnchecked<'a>>::HostType>,
[src]
&mut self,
array: &ReadArray<'a, T>
) -> Result<(), WriteError> where
Self: Sized,
T: ReadUnchecked<'a> + WriteBinary<<T as ReadUnchecked<'a>>::HostType>,
Write a ReadArray
instance to a WriteContext
.
fn write_vec<'a, T>(
&mut self,
vec: Vec<<T as ReadUnchecked<'a>>::HostType>
) -> Result<(), WriteError> where
Self: Sized,
T: ReadUnchecked<'a> + WriteBinary<<T as ReadUnchecked<'a>>::HostType>,
[src]
&mut self,
vec: Vec<<T as ReadUnchecked<'a>>::HostType>
) -> Result<(), WriteError> where
Self: Sized,
T: ReadUnchecked<'a> + WriteBinary<<T as ReadUnchecked<'a>>::HostType>,
Write a Vec
into a WriteContext
.
fn placeholder<'a, T, HostType>(
&mut self
) -> Result<Placeholder<T, HostType>, WriteError> where
T: WriteBinary<HostType> + ReadUnchecked<'a>,
[src]
&mut self
) -> Result<Placeholder<T, HostType>, WriteError> where
T: WriteBinary<HostType> + ReadUnchecked<'a>,
Return a placeholder to T
in the context for filling in later.
fn reserve<'a, T, HostType>(
&mut self,
count: usize
) -> Result<Placeholder<T, &'a HostType>, WriteError> where
T: WriteBinary<&'a HostType>,
[src]
&mut self,
count: usize
) -> Result<Placeholder<T, &'a HostType>, WriteError> where
T: WriteBinary<&'a HostType>,
Reserve space for count
bytes in the context for filling in later.
fn placeholder_array<'a, T, HostType>(
&mut self,
count: usize
) -> Result<Vec<Placeholder<T, HostType>>, WriteError> where
T: WriteBinary<HostType> + ReadUnchecked<'a>,
[src]
&mut self,
count: usize
) -> Result<Vec<Placeholder<T, HostType>>, WriteError> where
T: WriteBinary<HostType> + ReadUnchecked<'a>,
Return a Vec
of count
placeholders of type T
.
Implementors
impl WriteContext for WriteBuffer
[src]
fn write_bytes(&mut self, data: &[u8]) -> Result<(), WriteError>
[src]
fn write_zeros(&mut self, count: usize) -> Result<(), WriteError>
[src]
fn bytes_written(&self) -> usize
[src]
fn write_placeholder<T, HostType>(
&mut self,
placeholder: Placeholder<T, HostType>,
val: HostType
) -> Result<T::Output, WriteError> where
T: WriteBinary<HostType>,
[src]
&mut self,
placeholder: Placeholder<T, HostType>,
val: HostType
) -> Result<T::Output, WriteError> where
T: WriteBinary<HostType>,
impl WriteContext for WriteCounter
[src]
fn write_bytes(&mut self, data: &[u8]) -> Result<(), WriteError>
[src]
fn write_zeros(&mut self, count: usize) -> Result<(), WriteError>
[src]
fn bytes_written(&self) -> usize
[src]
fn write_placeholder<T, HostType>(
&mut self,
_placeholder: Placeholder<T, HostType>,
val: HostType
) -> Result<T::Output, WriteError> where
T: WriteBinary<HostType>,
[src]
&mut self,
_placeholder: Placeholder<T, HostType>,
val: HostType
) -> Result<T::Output, WriteError> where
T: WriteBinary<HostType>,