Trait MaybeTransportPacketMut

Source
pub trait MaybeTransportPacketMut<I: IpExt> {
    type TransportPacketMut<'a>: TransportPacketMut<I>
       where Self: 'a;

    // Required method
    fn transport_packet_mut(&mut self) -> Option<Self::TransportPacketMut<'_>>;
}
Expand description

A payload of an IP packet that may be a valid modifiable transport layer packet.

This trait exists to allow bubbling up the trait bound that a serializer type implement MaybeTransportPacketMut from the IP socket layer to upper layers, where it can be implemented separately on each concrete packet type depending on whether it supports packet header modification.

Required Associated Types§

Source

type TransportPacketMut<'a>: TransportPacketMut<I> where Self: 'a

The type that provides access to transport-layer header modification, if this is indeed a valid transport packet.

Required Methods§

Source

fn transport_packet_mut(&mut self) -> Option<Self::TransportPacketMut<'_>>

Optionally returns a type that provides mutable access to this transport-layer packet.

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.

Implementations on Foreign Types§

Source§

impl<I> MaybeTransportPacketMut<Ipv4> for InnerSerializer<IgmpMembershipReportV3Builder<I>, EmptyBuf>

Source§

impl<I: IpExt> MaybeTransportPacketMut<I> for Infallible

Source§

impl<I: IpExt, Inner> MaybeTransportPacketMut<I> for Nested<Inner, UdpPacketBuilder<I::Addr>>

Source§

type TransportPacketMut<'a> = &'a mut Nested<Inner, UdpPacketBuilder<<I as Ip>::Addr>> where Self: 'a

Source§

fn transport_packet_mut(&mut self) -> Option<Self::TransportPacketMut<'_>>

Source§

impl<I: IpExt, Inner, M: IcmpMessage<I>> MaybeTransportPacketMut<I> for Nested<Inner, IcmpPacketBuilder<I, M>>

Source§

type TransportPacketMut<'a> = &'a mut IcmpPacketBuilder<I, M> where M: 'a, Inner: 'a

Source§

fn transport_packet_mut(&mut self) -> Option<Self::TransportPacketMut<'_>>

Source§

impl<I: IpExt, Outer, Inner> MaybeTransportPacketMut<I> for Nested<Inner, TcpSegmentBuilderWithOptions<I::Addr, Outer>>

Source§

type TransportPacketMut<'a> = &'a mut Nested<Inner, TcpSegmentBuilderWithOptions<<I as Ip>::Addr, Outer>> where Self: 'a

Source§

fn transport_packet_mut(&mut self) -> Option<Self::TransportPacketMut<'_>>

Source§

impl<I: IpExt, T> MaybeTransportPacketMut<I> for &mut T

Source§

impl<I: IpExt, T: TransportPacketMut<I>> MaybeTransportPacketMut<I> for Option<T>

Source§

impl<M: MessageType<EmptyBuf>> MaybeTransportPacketMut<Ipv4> for InnerSerializer<IgmpPacketBuilder<EmptyBuf, M>, EmptyBuf>

Implementors§

Source§

impl<I: IpExt, B: BufferMut> MaybeTransportPacketMut<I> for RawIpBody<I, B>

Source§

type TransportPacketMut<'a> = ParsedTransportHeaderMut<'a, I> where Self: 'a