DecodeMessage

Trait DecodeMessage 

Source
pub trait DecodeMessage {
Show 34 associated items type Op; type Htype; type Hlen; type Hops; type Xid; type Secs; type Flags; type Ciaddr; type Yiaddr; type Siaddr; type Giaddr; type Chaddr; type Sname; type File; type Magic; type Options; type Output; // Required methods fn decode_op(op: &UndecodedMessage) -> Self::Op; fn decode_htype(htype: &UndecodedMessage) -> Self::Htype; fn decode_hlen(hlen: &UndecodedMessage) -> Self::Hlen; fn decode_hops(hops: &UndecodedMessage) -> Self::Hops; fn decode_xid(xid: &UndecodedMessage) -> Self::Xid; fn decode_secs(secs: &UndecodedMessage) -> Self::Secs; fn decode_flags(flags: &UndecodedMessage) -> Self::Flags; fn decode_ciaddr(ciaddr: &UndecodedMessage) -> Self::Ciaddr; fn decode_yiaddr(yiaddr: &UndecodedMessage) -> Self::Yiaddr; fn decode_siaddr(siaddr: &UndecodedMessage) -> Self::Siaddr; fn decode_giaddr(giaddr: &UndecodedMessage) -> Self::Giaddr; fn decode_chaddr(chaddr: &UndecodedMessage) -> Self::Chaddr; fn decode_sname(sname: &UndecodedMessage) -> Self::Sname; fn decode_file(file: &UndecodedMessage) -> Self::File; fn decode_magic(magic: &UndecodedMessage) -> Self::Magic; fn decode_options(options: &UndecodedMessage) -> Self::Options; fn from_bytes(undecoded: &UndecodedMessage) -> Self::Output;
}
Expand description

Define how the bytes of a DHCP message’s fields decode into your custom Message’s types.

…or don’t and use our homemade Message with this already implemented.

Required Associated Types§

Source

type Op

The type your custom Message uses to represent the op field.

Source

type Htype

The type your custom Message uses to represent the htype field.

Source

type Hlen

The type your custom Message uses to represent the hlen field.

Source

type Hops

The type your custom Message uses to represent the hops field.

Source

type Xid

The type your custom Message uses to represent the xid field.

Source

type Secs

The type your custom Message uses to represent the secs field.

Source

type Flags

The type your custom Message uses to represent the flags field.

Source

type Ciaddr

The type your custom Message uses to represent the ciaddr field.

Source

type Yiaddr

The type your custom Message uses to represent the yiaddr field.

Source

type Siaddr

The type your custom Message uses to represent the siaddr field.

Source

type Giaddr

The type your custom Message uses to represent the giaddr field.

Source

type Chaddr

The type your custom Message uses to represent the chaddr field.

Source

type Sname

The type your custom Message uses to represent the sname field.

Source

type File

The type your custom Message uses to represent the file field.

Source

type Magic

The type your custom Message uses to represent the magic field.

Source

type Options

The type your custom Message uses to represent the options field.

Source

type Output

Your custom Message.

Required Methods§

Source

fn decode_op(op: &UndecodedMessage) -> Self::Op

Convert an op field’s byte into your custom Message’s type.

Source

fn decode_htype(htype: &UndecodedMessage) -> Self::Htype

Convert an htype field’s byte into your custom Message’s type.

Source

fn decode_hlen(hlen: &UndecodedMessage) -> Self::Hlen

Convert an hlen field’s byte into your custom Message’s type.

Source

fn decode_hops(hops: &UndecodedMessage) -> Self::Hops

Convert an hops field’s byte into your custom Message’s type.

Source

fn decode_xid(xid: &UndecodedMessage) -> Self::Xid

Convert an xid field’s bytes into your custom Message’s type.

Source

fn decode_secs(secs: &UndecodedMessage) -> Self::Secs

Convert an secs field’s bytes into your custom Message’s type.

Source

fn decode_flags(flags: &UndecodedMessage) -> Self::Flags

Convert an flags field’s bytes into your custom Message’s type.

Source

fn decode_ciaddr(ciaddr: &UndecodedMessage) -> Self::Ciaddr

Convert an ciaddr field’s bytes into your custom Message’s type.

Source

fn decode_yiaddr(yiaddr: &UndecodedMessage) -> Self::Yiaddr

Convert an yiaddr field’s bytes into your custom Message’s type.

Source

fn decode_siaddr(siaddr: &UndecodedMessage) -> Self::Siaddr

Convert an siaddr field’s bytes into your custom Message’s type.

Source

fn decode_giaddr(giaddr: &UndecodedMessage) -> Self::Giaddr

Convert an giaddr field’s bytes into your custom Message’s type.

Source

fn decode_chaddr(chaddr: &UndecodedMessage) -> Self::Chaddr

Convert an chaddr field’s bytes into your custom Message’s type.

Source

fn decode_sname(sname: &UndecodedMessage) -> Self::Sname

Convert an sname field’s bytes into your custom Message’s type.

Source

fn decode_file(file: &UndecodedMessage) -> Self::File

Convert an file field’s bytes into your custom Message’s type.

Source

fn decode_magic(magic: &UndecodedMessage) -> Self::Magic

Convert an magic field’s bytes into your custom Message’s type.

Source

fn decode_options(options: &UndecodedMessage) -> Self::Options

Convert an options field’s bytes into your custom Message’s type.

Source

fn from_bytes(undecoded: &UndecodedMessage) -> Self::Output

decodes a byte array into a Message or other type that implements decodeMessage.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§