Struct lzss::VecWriter

source ·
pub struct VecWriter(_);
Available on crate features alloc or std only.
Expand description

Write into a vector.

In order to write into a referenced vector use IOSimpleWriter, and SliceReader to read from a vector.

Use void_write_unwrap to remove the Void from the result. Or void_unwrap if also the reader produces Void.

Implementations§

source§

impl VecWriter

source

pub fn with_capacity(capacity: usize) -> VecWriter

Constructs a new, empty writer with the specified capacity.

Note: The vector is not truncated to the actually used space.

Trait Implementations§

source§

impl Write for VecWriter

§

type Output = Vec<u8, Global>

Returns the generated vector.

§

type Error = Void

No error can occur.

source§

fn write(&mut self, data: u8) -> Result<(), Self::Error>

Write a byte.
source§

fn finish(self) -> Result<Self::Output, Self::Error>

Convert the writer into the output. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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, U> TryFrom<U> for Twhere U: Into<T>,

§

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 Twhere U: TryFrom<T>,

§

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.