Trait NextLayer

Source
pub trait NextLayer {
    type Denom: Copy + Eq;
    type Hint: Copy + Eq;

    // Provided methods
    fn next_layer(&self) -> Option<Self::Denom> { ... }
    fn next_layer_choice(
        &self,
        _hint: Option<Self::Hint>,
    ) -> Option<Self::Denom> { ... }
}
Expand description

Headers which can be queried for a hint, used to select the next layer in a packet.

Required Associated Types§

Source

type Denom: Copy + Eq

The type of this header’s next-layer hint.

Source

type Hint: Copy + Eq

A type used to help parse the header

Provided Methods§

Source

fn next_layer(&self) -> Option<Self::Denom>

Retrieve this header’s next-layer hint, if possible.

Source

fn next_layer_choice(&self, _hint: Option<Self::Hint>) -> Option<Self::Denom>

Try to retrieve this header’s next-layer hint, using a provided hint

Implementors§

Source§

impl<B: ByteSlice, T: for<'a> HasView<&'a [u8]> + HasView<B> + NextLayer<Hint = <T as NextLayer>::Denom>> NextLayer for RepeatedView<B, T>
where for<'a> <T as HasView<&'a [u8]>>::ViewType: HeaderParse<&'a [u8]> + NextLayer<Denom = T::Denom, Hint = T::Hint>,

Source§

impl<O: NextLayer, B> NextLayer for BoxedHeader<O, B>
where B: NextLayer<Denom = O::Denom, Hint = O::Hint>,

Source§

impl<O: NextLayer, B> NextLayer for InlineHeader<O, B>
where B: NextLayer<Denom = O::Denom, Hint = O::Hint>,

Source§

impl<T> NextLayer for Repeated<T>
where T: NextLayer<Hint = <T as NextLayer>::Denom>,

Source§

impl<T: HasView<V, ViewType = Q> + NextLayer, V, Q> NextLayer for FieldMut<'_, T, V>
where <T as HasView<V>>::ViewType: NextLayer<Denom = T::Denom, Hint = T::Hint>,

Source§

impl<T: HasView<V, ViewType = Q> + NextLayer, V, Q> NextLayer for FieldRef<'_, T, V>
where <T as HasView<V>>::ViewType: NextLayer<Denom = T::Denom, Hint = T::Hint>,