Struct DataGenOutput

Source
pub struct DataGenOutput<'a> { /* private fields */ }

Implementations§

Source§

impl<'a> DataGenOutput<'a>

Source

pub fn new(writer: &'a mut dyn Write) -> DataGenOutput<'a>

Source

pub fn write_bytes(&mut self, bytes: &[u8]) -> Result<u64>

Source

pub fn write_string<D: Display + ?Sized>(&mut self, value: &D) -> Result<u64>

Source

pub fn write<O: OutputType>(&mut self, value: &O) -> Result<u64, Error>

Source

pub fn with<F, T>(&mut self, fun: F) -> Result<u64, Error>
where F: FnOnce(&mut DataGenOutput<'_>) -> Result<T, Error>,

Source

pub fn flush(&mut self) -> Result<()>

Trait Implementations§

Source§

impl<'a> ByteWriter for DataGenOutput<'a>

Source§

fn write_byte(&mut self, b: u8)

Writes a single byte.
Source§

fn write_bytes(&mut self, v: &[u8])

Writes a number of bytes.
Source§

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. RawEncoders are recommended but not required to call this method with an appropriate estimate. By default this method does nothing.

Auto Trait Implementations§

§

impl<'a> Freeze for DataGenOutput<'a>

§

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§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.