DataWrite

Struct DataWrite 

Source
pub struct DataWrite<'d> { /* private fields */ }

Implementations§

Source§

impl<'d> DataWrite<'d>

Source

pub fn write_bool(&mut self, val: bool) -> Result<(), WriteError>

Source

pub fn write_u8(&mut self, val: u8) -> Result<(), WriteError>

Source

pub fn write_i8(&mut self, val: i8) -> Result<(), WriteError>

Source

pub fn write_u16(&mut self, val: u16) -> Result<(), WriteError>

Source

pub fn write_i16(&mut self, val: i16) -> Result<(), WriteError>

Source

pub fn write_u32(&mut self, val: u32) -> Result<(), WriteError>

Source

pub fn write_i32(&mut self, val: i32) -> Result<(), WriteError>

Source

pub fn write_f32(&mut self, val: f32) -> Result<(), WriteError>

Source

pub fn write_u64(&mut self, val: u64) -> Result<(), WriteError>

Source

pub fn write_i64(&mut self, val: i64) -> Result<(), WriteError>

Source

pub fn write_f64(&mut self, val: f64) -> Result<(), WriteError>

Source

pub fn write_utf(&mut self, val: &str) -> Result<(), WriteError>

Source

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

Source

pub const fn is_owned(&self) -> bool

Source

pub fn get_written(&self) -> &[u8]

Source

pub fn consume(self) -> Vec<u8>

eat this datawrite

panics if ref write buffer

Source

pub fn inflate(self, to: &mut DataWrite<'_>) -> Result<(), CompressError>

Trait Implementations§

Source§

impl Default for DataWrite<'static>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'d> From<&'d mut [u8]> for DataWrite<'d>

Source§

fn from(value: &'d mut [u8]) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<u8>> for DataWrite<'static>

Source§

fn from(value: Vec<u8>) -> Self

Converts to this type from the input type.
Source§

impl<'d> TryFrom<DataWrite<'d>> for Vec<u8>

Source§

type Error = ()

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

fn try_from(value: DataWrite<'d>) -> Result<Self, Self::Error>

Performs the conversion.

Auto Trait Implementations§

§

impl<'d> Freeze for DataWrite<'d>

§

impl<'d> RefUnwindSafe for DataWrite<'d>

§

impl<'d> Send for DataWrite<'d>

§

impl<'d> Sync for DataWrite<'d>

§

impl<'d> Unpin for DataWrite<'d>

§

impl<'d> !UnwindSafe for DataWrite<'d>

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> Join<T, 1, 1, T> for T

Source§

fn join(self, with: T) -> [T; 2]

Join a array and an scalar together. For joining two arrays together, see Couple. Read more
Source§

impl<T, const O: usize> Join<T, 1, O, [T; O]> for T

Source§

fn join(self, with: [T; O]) -> [T; { _ }]

Join a array and an scalar together. For joining two arrays together, see Couple. 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.