Struct dhcproto::encoder::Encoder[][src]

pub struct Encoder<'a> { /* fields omitted */ }
Expand description

Encoder type, holds a mut ref to a buffer that it will write data to and an offset of the next position to write

Implementations

Create a new Encoder from a mutable buffer

Get a reference to the underlying buffer

write bytes to buffer Return: number of bytes written

Write const number of bytes to buffer

write a u8

write a u16

write a u32

write a u128

write a u64

write a i32

Writes bytes to buffer and pads with 0 bytes up to some fill_len

Returns Err - if bytes.len() is greater then fill_len

Writes value to buffer and pads with 0 bytes up to some fill_len if String is None then write fill_len 0 bytes

Returns Err - if bytes.len() is greater then fill_len

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.