Struct BinaryWriterVE

Source
pub struct BinaryWriterVE<W> { /* private fields */ }

Implementations§

Source§

impl<W: Write> BinaryWriterVE<W>

Source

pub fn new(inner: W, endian: Endian) -> Self

Source§

impl<R: Seek> BinaryWriterVE<R>

Source

pub fn align(&mut self, alignment: usize) -> Result<()>

Trait Implementations§

Source§

impl<W: Write> BinaryWrite for BinaryWriterVE<W>

Source§

fn write_bool(&mut self, value: bool) -> Result<()>

Writes a bool to the internal stream.
Source§

fn write_char(&mut self, value: char) -> Result<()>

Writes a char to the internal stream.
Source§

fn write_f16(&mut self, value: f32) -> Result<()>

Writes a f16 to the internal stream.
Source§

fn write_cstr(&mut self, value: &str) -> Result<()>

Writes a str as c-string (null-terminated) to the internal stream.
Source§

fn write_str(&mut self, value: &str, write_len: Option<bool>) -> Result<()>

Writes a str to the internal stream. If write_len is Some(true), the length of the string will be written before the string itself.
Source§

fn write_bytes(&mut self, value: &[u8], write_len: Option<bool>) -> Result<()>

Writes a byte slice to the internal stream. If write_len is Some(true), the length of the byte slice will be written before the byte slice itself.
Source§

fn write_bool_array( &mut self, value: Vec<bool>, write_len: Option<bool>, ) -> Result<()>

Writes a bool array to the internal stream. If write_len is Some(true), the length of the array will be written before the array itself.
Source§

fn write_char_array( &mut self, value: Vec<char>, write_len: Option<bool>, ) -> Result<()>

Writes a char array to the internal stream. If write_len is Some(true), the length of the array will be written before the array itself.
Source§

fn write_f16_array( &mut self, value: Vec<f32>, write_len: Option<bool>, ) -> Result<()>

Writes a f16 array to the internal stream. If write_len is Some(true), the length of the array will be written before the array itself.
Source§

fn write_cstr_array( &mut self, value: Vec<&str>, write_len: Option<bool>, ) -> Result<()>

Writes a str array as c-strings (null-terminated) to the internal stream. If write_len is Some(true), the length of the array will be written before the array itself.
Source§

fn write_str_array( &mut self, value: Vec<&str>, write_len: Option<bool>, ) -> Result<()>

Writes a str array to the internal stream. If write_len is Some(true), the length of the array will be written before the array itself.
Source§

fn write_bytes_array( &mut self, value: Vec<&[u8]>, write_len: Option<bool>, ) -> Result<()>

Writes a byte slice array to the internal stream. If write_len is Some(true), the length of the array will be written before the array itself.
Source§

fn write_u8(&mut self, value: u8) -> Result<()>

Writes a u8 to the internal stream.
Source§

fn write_u8_array( &mut self, value: Vec<u8>, write_len: Option<bool>, ) -> Result<()>

Writes a u8 array to the internal stream. If write_len is Some(true), the length of the array will be written before the array itself.
Source§

fn write_u16(&mut self, value: u16) -> Result<()>

Writes a u16 to the internal stream.
Source§

fn write_u16_array( &mut self, value: Vec<u16>, write_len: Option<bool>, ) -> Result<()>

Writes a u16 array to the internal stream. If write_len is Some(true), the length of the array will be written before the array itself.
Source§

fn write_u32(&mut self, value: u32) -> Result<()>

Writes a u32 to the internal stream.
Source§

fn write_u32_array( &mut self, value: Vec<u32>, write_len: Option<bool>, ) -> Result<()>

Writes a u32 array to the internal stream. If write_len is Some(true), the length of the array will be written before the array itself.
Source§

fn write_u64(&mut self, value: u64) -> Result<()>

Writes a u64 to the internal stream.
Source§

fn write_u64_array( &mut self, value: Vec<u64>, write_len: Option<bool>, ) -> Result<()>

Writes a u64 array to the internal stream. If write_len is Some(true), the length of the array will be written before the array itself.
Source§

fn write_i8(&mut self, value: i8) -> Result<()>

Writes a i8 to the internal stream.
Source§

fn write_i8_array( &mut self, value: Vec<i8>, write_len: Option<bool>, ) -> Result<()>

Writes a i8 array to the internal stream. If write_len is Some(true), the length of the array will be written before the array itself.
Source§

fn write_i16(&mut self, value: i16) -> Result<()>

Writes a i16 to the internal stream.
Source§

fn write_i16_array( &mut self, value: Vec<i16>, write_len: Option<bool>, ) -> Result<()>

Writes a i16 array to the internal stream. If write_len is Some(true), the length of the array will be written before the array itself.
Source§

fn write_i32(&mut self, value: i32) -> Result<()>

Writes a i32 to the internal stream.
Source§

fn write_i32_array( &mut self, value: Vec<i32>, write_len: Option<bool>, ) -> Result<()>

Writes a i32 array to the internal stream. If write_len is Some(true), the length of the array will be written before the array itself.
Source§

fn write_i64(&mut self, value: i64) -> Result<()>

Writes a i64 to the internal stream.
Source§

fn write_i64_array( &mut self, value: Vec<i64>, write_len: Option<bool>, ) -> Result<()>

Writes a i64 array to the internal stream. If write_len is Some(true), the length of the array will be written before the array itself.
Source§

fn write_f32(&mut self, value: f32) -> Result<()>

Writes a f32 to the internal stream.
Source§

fn write_f32_array( &mut self, value: Vec<f32>, write_len: Option<bool>, ) -> Result<()>

Writes a f32 array to the internal stream. If write_len is Some(true), the length of the array will be written before the array itself.
Source§

fn write_f64(&mut self, value: f64) -> Result<()>

Writes a f64 to the internal stream.
Source§

fn write_f64_array( &mut self, value: Vec<f64>, write_len: Option<bool>, ) -> Result<()>

Writes a f64 array to the internal stream. If write_len is Some(true), the length of the array will be written before the array itself.
Source§

impl<R: Seek> Seek for BinaryWriterVE<R>

Source§

fn seek(&mut self, pos: SeekFrom) -> Result<u64>

Seek to an offset, in bytes, in a stream. Read more
Source§

fn stream_position(&mut self) -> Result<u64>

Returns the current seek position from the start of the stream. Read more
1.55.0 · Source§

fn rewind(&mut self) -> Result<(), Error>

Rewind to the beginning of a stream. Read more
Source§

fn stream_len(&mut self) -> Result<u64, Error>

🔬This is a nightly-only experimental API. (seek_stream_len)
Returns the length of this stream (in bytes). Read more
1.80.0 · Source§

fn seek_relative(&mut self, offset: i64) -> Result<(), Error>

Seeks relative to the current position. Read more

Auto Trait Implementations§

§

impl<W> Freeze for BinaryWriterVE<W>
where W: Freeze,

§

impl<W> RefUnwindSafe for BinaryWriterVE<W>
where W: RefUnwindSafe,

§

impl<W> Send for BinaryWriterVE<W>
where W: Send,

§

impl<W> Sync for BinaryWriterVE<W>
where W: Sync,

§

impl<W> Unpin for BinaryWriterVE<W>
where W: Unpin,

§

impl<W> UnwindSafe for BinaryWriterVE<W>
where W: UnwindSafe,

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, 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.