pub trait RoundtripData: Sized {
// Required methods
fn from_incoming(incoming: &Pktsnip<Shared>) -> Option<Self>;
fn wrap(
self,
payload: Pktsnip<Shared>,
) -> Result<Pktsnip<Shared>, NotEnoughSpace>;
}
Available on
riot_module_gnrc
only.Expand description
Trait of data structures that store all the information needed to respond to a Pktsnip in some way; the data (typically address and port information) is copied into the trait implementation and persisted there while the original snip is dropped and a new one is written.
This trait, in future, might also participate in the re-use of snips that are not dropped and re-allocated but turned into responses in-place, but whether that makes sense here remains to be seen.
Required Methods§
sourcefn from_incoming(incoming: &Pktsnip<Shared>) -> Option<Self>
fn from_incoming(incoming: &Pktsnip<Shared>) -> Option<Self>
Read round trip data from an incoming packet.
This returns something if the packet can fundamentally be responded to, which is usually the case.
fn wrap( self, payload: Pktsnip<Shared>, ) -> Result<Pktsnip<Shared>, NotEnoughSpace>
Object Safety§
This trait is not object safe.
Implementors§
impl RoundtripData for NetifRoundtripData
impl<N: RoundtripData> RoundtripData for IPv6RoundtripDataFull<N>
Available on
riot_module_ipv6
only.impl<N: RoundtripData> RoundtripData for UDPRoundtripDataFull<N>
Available on
riot_module_gnrc_udp
only.