pub enum InternalForwarding<D> {
Used(D),
NotUsed,
}
Expand description
Internal forwarding semantics.
Internal forwarding allows the netstack to behave as a Weak Host when forwarding is enabled on a device.
In a sending context, internal forwarding allows sending a packet out of a device using a source address not assigned to that device, provided that the source address is assigned to another device, and that other device has forwarding enabled.
In a receiving context, internal forwarding allows receiving a packet that was destined to an address not assigned to the device that is arrived on, provided that destination address is assigned to another device and the device the packet arrived on has forwarding enabled.
Variants§
Used(D)
Internal forwarding is being used. The relevant address (src addr when sending, dst addr when receiving) is assigned to the provided device.
NotUsed
Internal forwarding is not being used.
Implementations§
Source§impl<D> InternalForwarding<D>
impl<D> InternalForwarding<D>
Sourcepub fn map_device<F: FnOnce(D) -> O, O>(self, cb: F) -> InternalForwarding<O>
pub fn map_device<F: FnOnce(D) -> O, O>(self, cb: F) -> InternalForwarding<O>
Applies the given callback to the held device identifier.
Trait Implementations§
Source§impl<D: Clone> Clone for InternalForwarding<D>
impl<D: Clone> Clone for InternalForwarding<D>
Source§fn clone(&self) -> InternalForwarding<D>
fn clone(&self) -> InternalForwarding<D>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<D: Debug> Debug for InternalForwarding<D>
impl<D: Debug> Debug for InternalForwarding<D>
Source§impl<D: PartialEq> PartialEq for InternalForwarding<D>
impl<D: PartialEq> PartialEq for InternalForwarding<D>
impl<D: Copy> Copy for InternalForwarding<D>
impl<D: Eq> Eq for InternalForwarding<D>
impl<D> StructuralPartialEq for InternalForwarding<D>
Auto Trait Implementations§
impl<D> Freeze for InternalForwarding<D>where
D: Freeze,
impl<D> RefUnwindSafe for InternalForwarding<D>where
D: RefUnwindSafe,
impl<D> Send for InternalForwarding<D>where
D: Send,
impl<D> Sync for InternalForwarding<D>where
D: Sync,
impl<D> Unpin for InternalForwarding<D>where
D: Unpin,
impl<D> UnwindSafe for InternalForwarding<D>where
D: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)