Struct write_into::Sleb128
source · [−]pub struct Sleb128<T>(pub T);
Expand description
Used to write values in LEB-128 format (signed).
Example
use write_into::{Sleb128, write_into};
let mut buffer = Vec::new();
write_into(&mut buffer, Sleb128(-69i32)).unwrap();
assert_eq!(&buffer, &[0xBB, 0x7F]);
Tuple Fields
0: T
Trait Implementations
sourceimpl WriteInto for Sleb128<i8>
impl WriteInto for Sleb128<i8>
type Output = usize
type Output = usize
Result of WriteInto::write_into
function (e.g. ()
or usize
).
sourcefn write_into(self, sink: &mut impl Write) -> Result<Self::Output>
fn write_into(self, sink: &mut impl Write) -> Result<Self::Output>
Writes value into I/O sink.
sourceimpl WriteInto for &Sleb128<i8>
impl WriteInto for &Sleb128<i8>
type Output = usize
type Output = usize
Result of WriteInto::write_into
function (e.g. ()
or usize
).
sourcefn write_into(self, sink: &mut impl Write) -> Result<Self::Output>
fn write_into(self, sink: &mut impl Write) -> Result<Self::Output>
Writes value into I/O sink.
sourceimpl WriteInto for Sleb128<isize>
impl WriteInto for Sleb128<isize>
type Output = usize
type Output = usize
Result of WriteInto::write_into
function (e.g. ()
or usize
).
sourcefn write_into(self, sink: &mut impl Write) -> Result<Self::Output>
fn write_into(self, sink: &mut impl Write) -> Result<Self::Output>
Writes value into I/O sink.
sourceimpl WriteInto for &Sleb128<isize>
impl WriteInto for &Sleb128<isize>
type Output = usize
type Output = usize
Result of WriteInto::write_into
function (e.g. ()
or usize
).
sourcefn write_into(self, sink: &mut impl Write) -> Result<Self::Output>
fn write_into(self, sink: &mut impl Write) -> Result<Self::Output>
Writes value into I/O sink.
sourceimpl WriteInto for Sleb128<i16>
impl WriteInto for Sleb128<i16>
type Output = usize
type Output = usize
Result of WriteInto::write_into
function (e.g. ()
or usize
).
sourcefn write_into(self, sink: &mut impl Write) -> Result<Self::Output>
fn write_into(self, sink: &mut impl Write) -> Result<Self::Output>
Writes value into I/O sink.
sourceimpl WriteInto for &Sleb128<i16>
impl WriteInto for &Sleb128<i16>
type Output = usize
type Output = usize
Result of WriteInto::write_into
function (e.g. ()
or usize
).
sourcefn write_into(self, sink: &mut impl Write) -> Result<Self::Output>
fn write_into(self, sink: &mut impl Write) -> Result<Self::Output>
Writes value into I/O sink.
sourceimpl WriteInto for Sleb128<i32>
impl WriteInto for Sleb128<i32>
type Output = usize
type Output = usize
Result of WriteInto::write_into
function (e.g. ()
or usize
).
sourcefn write_into(self, sink: &mut impl Write) -> Result<Self::Output>
fn write_into(self, sink: &mut impl Write) -> Result<Self::Output>
Writes value into I/O sink.
sourceimpl WriteInto for &Sleb128<i32>
impl WriteInto for &Sleb128<i32>
type Output = usize
type Output = usize
Result of WriteInto::write_into
function (e.g. ()
or usize
).
sourcefn write_into(self, sink: &mut impl Write) -> Result<Self::Output>
fn write_into(self, sink: &mut impl Write) -> Result<Self::Output>
Writes value into I/O sink.
sourceimpl WriteInto for Sleb128<i64>
impl WriteInto for Sleb128<i64>
type Output = usize
type Output = usize
Result of WriteInto::write_into
function (e.g. ()
or usize
).
sourcefn write_into(self, sink: &mut impl Write) -> Result<Self::Output>
fn write_into(self, sink: &mut impl Write) -> Result<Self::Output>
Writes value into I/O sink.
sourceimpl WriteInto for &Sleb128<i64>
impl WriteInto for &Sleb128<i64>
type Output = usize
type Output = usize
Result of WriteInto::write_into
function (e.g. ()
or usize
).
sourcefn write_into(self, sink: &mut impl Write) -> Result<Self::Output>
fn write_into(self, sink: &mut impl Write) -> Result<Self::Output>
Writes value into I/O sink.
Auto Trait Implementations
impl<T> RefUnwindSafe for Sleb128<T> where
T: RefUnwindSafe,
impl<T> Send for Sleb128<T> where
T: Send,
impl<T> Sync for Sleb128<T> where
T: Sync,
impl<T> Unpin for Sleb128<T> where
T: Unpin,
impl<T> UnwindSafe for Sleb128<T> where
T: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more