[−][src]Struct bytecodec::fixnum::U40leEncoder
Encoder which encodes unsigned 40-bit integers by little-endian byte order.
Although the type of items is u64
, the most significant 24-bits must be 0
.
Examples
use bytecodec::EncodeExt; use bytecodec::fixnum::U40leEncoder; use bytecodec::io::IoEncodeExt; let mut output = Vec::new(); let mut encoder = U40leEncoder::with_item(0x0000_0001_0203_0405).unwrap(); encoder.encode_all(&mut output).unwrap(); assert_eq!(output, [0x05, 0x04, 0x03, 0x02, 0x01]);
Methods
impl U40leEncoder
[src]
Trait Implementations
impl Debug for U40leEncoder
[src]
impl Default for U40leEncoder
[src]
fn default() -> U40leEncoder
[src]
impl Encode for U40leEncoder
[src]
type Item = u64
The type of items to be encoded.
fn encode(&mut self, buf: &mut [u8], eos: Eos) -> Result<usize>
[src]
fn start_encoding(&mut self, item: Self::Item) -> Result<()>
[src]
fn requiring_bytes(&self) -> ByteCount
[src]
fn is_idle(&self) -> bool
[src]
impl SizedEncode for U40leEncoder
[src]
fn exact_requiring_bytes(&self) -> u64
[src]
Auto Trait Implementations
impl RefUnwindSafe for U40leEncoder
impl Send for U40leEncoder
impl Sync for U40leEncoder
impl Unpin for U40leEncoder
impl UnwindSafe for U40leEncoder
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IoEncodeExt for T where
T: Encode,
[src]
T: Encode,
fn encode_to_write_buf<B>(&mut self, buf: &mut WriteBuf<B>) -> Result<()> where
B: AsMut<[u8]>,
[src]
B: AsMut<[u8]>,
fn encode_all<W: Write>(&mut self, writer: W) -> Result<()>
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,