Struct dgen::DataGenOutput
source · pub struct DataGenOutput<'a> { /* private fields */ }
Implementations
sourceimpl<'a> DataGenOutput<'a>
impl<'a> DataGenOutput<'a>
pub fn new(writer: &'a mut dyn Write) -> DataGenOutput<'a>
pub fn write_bytes(&mut self, bytes: &[u8]) -> Result<u64>
pub fn write_string<D: Display + ?Sized>(&mut self, value: &D) -> Result<u64>
pub fn write<O: OutputType>(&mut self, value: &O) -> Result<u64, Error>
pub fn with<F, T>(&mut self, fun: F) -> Result<u64, Error>where
F: FnOnce(&mut DataGenOutput<'_>) -> Result<T, Error>,
pub fn flush(&mut self) -> Result<()>
Trait Implementations
sourceimpl<'a> ByteWriter for DataGenOutput<'a>
impl<'a> ByteWriter for DataGenOutput<'a>
sourcefn write_byte(&mut self, b: u8)
fn write_byte(&mut self, b: u8)
Writes a single byte.
sourcefn write_bytes(&mut self, v: &[u8])
fn write_bytes(&mut self, v: &[u8])
Writes a number of bytes.
sourcefn writer_hint(&mut self, _expectedlen: usize)
fn writer_hint(&mut self, _expectedlen: usize)
Hints an expected lower bound on the length (in bytes) of the output
until the next call to
writer_hint
,
so that the writer can reserve the memory for writing.
RawEncoder
s are recommended but not required to call this method
with an appropriate estimate.
By default this method does nothing. Read moreAuto Trait Implementations
impl<'a> !RefUnwindSafe for DataGenOutput<'a>
impl<'a> !Send for DataGenOutput<'a>
impl<'a> !Sync for DataGenOutput<'a>
impl<'a> Unpin for DataGenOutput<'a>
impl<'a> !UnwindSafe for DataGenOutput<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more