pub enum Payload {
    V4(Ipv4Prefix),
    V6(Ipv6Prefix),
}
Expand description

All possible payload types.

Variants

V4(Ipv4Prefix)

An IPv4 prefix.

V6(Ipv6Prefix)

An IPv6 prefix.

Implementations

Creates an payload value for the given payload.

Reads a payload PDU from a reader.

The return type is a little convoluted, but hey. The method returns Ok(Ok(Some(payload))) if reading went well and there was a payload PDU that we support. It returns Ok(Ok(None)), if reading went well and there was a payload PDU but we don’t actually support it. If reading went well but we received an end-of-data PDU, it will be returned as Ok(Err(eod)). If reading fails or any other PDU is received, an error is returned.

The reason we are just not returning unsupported payload types is that router keys are variable length and we would need to allocate data. Which is a bit wasteful if we then just proceed to throw it away.

Returns the RTR version of the payload PDU.

Returns the flags of the payload PDU.

Writes the payload PDU to a writer.

Converts the payload PDU into action and payload.

Trait Implementations

Converts this type into a mutable reference of the (usually inferred) input type.

Converts this type into a shared reference of the (usually inferred) input type.

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.