Skip to main content

ToOwnedPacket

Trait ToOwnedPacket 

Source
pub trait ToOwnedPacket: NextLayer {
    type Target;

    // Required method
    fn to_owned(&self, hint: Option<Self::Hint>) -> ParseResult<Self::Target>;
}
Expand description

Converts a borrowed view of a header into an owned version, possibly reparsing to do so.

This trait is used to support cases which are ambiguous on their own, such as Repeated views over extension headers.

Required Associated Types§

Source

type Target

The output type of this conversion.

Required Methods§

Source

fn to_owned(&self, hint: Option<Self::Hint>) -> ParseResult<Self::Target>

Converts a borrowed view of a header into an owned version, possibly reparsing to do so with the aid of hint.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<B: SplitByteSlice, T, E> ToOwnedPacket for RepeatedView<B, T>
where T: for<'a> HasView<&'a [u8]> + NextLayer<Hint = <T as NextLayer>::Denom> + HasView<B>, for<'a> <T as HasView<&'a [u8]>>::ViewType: HeaderParse<&'a [u8]> + NextLayer<Denom = T::Denom, Hint = T::Hint>, for<'a, 'b> &'b <T as HasView<&'a [u8]>>::ViewType: TryInto<T, Error = E>, ParseError: From<E>,

Source§

impl<O: NextLayer + Clone, B: NextLayer<Denom = O::Denom, Hint = O::Hint> + ToOwnedPacket<Target = O>> ToOwnedPacket for BoxedHeader<O, B>

Available on crate feature alloc only.
Source§

impl<O: NextLayer + Clone, B: NextLayer<Denom = O::Denom, Hint = O::Hint> + ToOwnedPacket<Target = O>> ToOwnedPacket for InlineHeader<O, B>