Trait zettabgp::BgpAddrItem

source ·
pub trait BgpAddrItem<T: Sized> {
    // Required methods
    fn decode_from(
        mode: BgpTransportMode,
        buf: &[u8]
    ) -> Result<(T, usize), BgpError>;
    fn encode_to(
        &self,
        mode: BgpTransportMode,
        buf: &mut [u8]
    ) -> Result<usize, BgpError>;
}
Expand description

This trait represens NLRI which have sequental chain encoding with opaque length.

Required Methods§

source

fn decode_from( mode: BgpTransportMode, buf: &[u8] ) -> Result<(T, usize), BgpError>

Decode from buffer. Returns entity and consumed buffer length, or error.

source

fn encode_to( &self, mode: BgpTransportMode, buf: &mut [u8] ) -> Result<usize, BgpError>

Encode entity into the buffer. Returns consumed buffer length, or error.

Object Safety§

This trait is not object safe.

Implementors§