Struct measureme::SerializationSink[][src]

pub struct SerializationSink { /* fields omitted */ }

Implementations

impl SerializationSink[src]

pub fn into_bytes(self) -> Vec<u8>[src]

Creates a copy of all data written so far. This method is meant to be used for writing unit tests. It will panic if the underlying BackingStorage is a file.

pub fn write_atomic<W>(&self, num_bytes: usize, write: W) -> Addr where
    W: FnOnce(&mut [u8]), 
[src]

Atomically writes num_bytes of data to this SerializationSink. Atomic means the data is guaranteed to be written as a contiguous range of bytes.

The buffer provided to the write callback is guaranteed to be of size num_bytes and write is supposed to completely fill it with the data to be written.

The return value is the address of the data written and can be used to refer to the data later on.

pub fn write_bytes_atomic(&self, bytes: &[u8]) -> Addr[src]

Atomically writes the data in bytes to this SerializationSink. Atomic means the data is guaranteed to be written as a contiguous range of bytes.

This method may perform better than write_atomic because it may be able to skip the sink’s internal buffer. Use this method if the data to be written is already available as a &[u8].

The return value is the address of the data written and can be used to refer to the data later on.

pub fn as_std_write<'a>(&'a self) -> impl Write + 'a[src]

Trait Implementations

impl Debug for SerializationSink[src]

fn fmt(&self, f: &mut Formatter<'_>) -> Result[src]

Formats the value using the given formatter. Read more

impl Drop for SerializationSink[src]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

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

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

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

Performs the conversion.