pub struct Writer<'a> { /* private fields */ }Implementations§
Source§impl Writer<'_>
impl Writer<'_>
Sourcepub fn get_offset(&self) -> usize
pub fn get_offset(&self) -> usize
Gets the offset of the writer.
Sourcepub fn seek(&mut self, offset: usize, position: u8)
pub fn seek(&mut self, offset: usize, position: u8)
Seek to a new offset, from 0 (start), 1 (current), or 2 (end) of the buffer.
Sourcepub fn write_uint8(&mut self, data: u8, endianness: bool) -> u8
pub fn write_uint8(&mut self, data: u8, endianness: bool) -> u8
Writes an 8 bit unsigned int to the buffer.
Sourcepub fn write_uint16(&mut self, data: u16, endianness: bool) -> u8
pub fn write_uint16(&mut self, data: u16, endianness: bool) -> u8
Writes a 16 bit unsigned int to the buffer.
Sourcepub fn write_uint32(&mut self, data: u32, endianness: bool) -> u8
pub fn write_uint32(&mut self, data: u32, endianness: bool) -> u8
Writes a 32 bit unsigned int to the buffer.
Sourcepub fn write_uint64(&mut self, data: u64, endianness: bool) -> u8
pub fn write_uint64(&mut self, data: u64, endianness: bool) -> u8
Writes a 64 bit unsigned int to the buffer.
Sourcepub fn write_int8(&mut self, data: i8, endianness: bool) -> u8
pub fn write_int8(&mut self, data: i8, endianness: bool) -> u8
Writes an 8 bit signed int to the buffer.
Sourcepub fn write_int16(&mut self, data: i16, endianness: bool) -> u8
pub fn write_int16(&mut self, data: i16, endianness: bool) -> u8
Writes a 16 bit signed int to the buffer.
Sourcepub fn write_int32(&mut self, data: i32, endianness: bool) -> u8
pub fn write_int32(&mut self, data: i32, endianness: bool) -> u8
Writes a 32 bit signed int to the buffer.
Sourcepub fn write_int64(&mut self, data: i64, endianness: bool) -> u8
pub fn write_int64(&mut self, data: i64, endianness: bool) -> u8
Writes a 64 bit signed int to the buffer.
Sourcepub fn write_float32(&mut self, data: f32, endianness: bool) -> u8
pub fn write_float32(&mut self, data: f32, endianness: bool) -> u8
Writes a 32 bit float to the buffer.
Sourcepub fn write_float64(&mut self, data: f64, endianness: bool) -> u8
pub fn write_float64(&mut self, data: f64, endianness: bool) -> u8
Writes a 64 bit float to the buffer.
Auto Trait Implementations§
impl<'a> Freeze for Writer<'a>
impl<'a> RefUnwindSafe for Writer<'a>
impl<'a> Send for Writer<'a>
impl<'a> Sync for Writer<'a>
impl<'a> Unpin for Writer<'a>
impl<'a> !UnwindSafe for Writer<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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