pub struct SocketHopLimits<I: Ip> {
pub unicast: Option<NonZeroU8>,
pub multicast: Option<NonZeroU8>,
pub version: IpVersionMarker<I>,
}
Expand description
The configurable hop limits for a socket.
Fields§
§unicast: Option<NonZeroU8>
Unicast hop limit.
multicast: Option<NonZeroU8>
Multicast hop limit.
version: IpVersionMarker<I>
An unused marker type signifying the IP version for which these hop limits are valid. Including this helps prevent using the wrong hop limits when operating on dualstack sockets.
Implementations§
Source§impl<I: Ip> SocketHopLimits<I>
impl<I: Ip> SocketHopLimits<I>
Sourcepub fn set_unicast(value: Option<NonZeroU8>) -> impl FnOnce(&mut Self)
pub fn set_unicast(value: Option<NonZeroU8>) -> impl FnOnce(&mut Self)
Returns a function that updates the unicast hop limit.
Sourcepub fn set_multicast(value: Option<NonZeroU8>) -> impl FnOnce(&mut Self)
pub fn set_multicast(value: Option<NonZeroU8>) -> impl FnOnce(&mut Self)
Returns a function that updates the multicast hop limit.
Sourcepub fn get_limits_with_defaults(&self, defaults: &HopLimits) -> HopLimits
pub fn get_limits_with_defaults(&self, defaults: &HopLimits) -> HopLimits
Returns the hop limits, or the provided defaults if unset.
Sourcepub fn hop_limit_for_dst(
&self,
destination: &SpecifiedAddr<I::Addr>,
) -> Option<NonZeroU8>
pub fn hop_limit_for_dst( &self, destination: &SpecifiedAddr<I::Addr>, ) -> Option<NonZeroU8>
Returns the appropriate hop limit to use for the given destination addr.
Trait Implementations§
Source§impl<I: Clone + Ip> Clone for SocketHopLimits<I>
impl<I: Clone + Ip> Clone for SocketHopLimits<I>
Source§fn clone(&self) -> SocketHopLimits<I>
fn clone(&self) -> SocketHopLimits<I>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<I: Default + Ip> Default for SocketHopLimits<I>
impl<I: Default + Ip> Default for SocketHopLimits<I>
Source§fn default() -> SocketHopLimits<I>
fn default() -> SocketHopLimits<I>
Returns the “default value” for a type. Read more
impl<I: Copy + Ip> Copy for SocketHopLimits<I>
impl<I: Eq + Ip> Eq for SocketHopLimits<I>
impl<I: Ip> StructuralPartialEq for SocketHopLimits<I>
Auto Trait Implementations§
impl<I> Freeze for SocketHopLimits<I>
impl<I> RefUnwindSafe for SocketHopLimits<I>where
I: RefUnwindSafe,
impl<I> Send for SocketHopLimits<I>
impl<I> Sync for SocketHopLimits<I>
impl<I> Unpin for SocketHopLimits<I>where
I: Unpin,
impl<I> UnwindSafe for SocketHopLimits<I>where
I: 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
Mutably borrows from an owned value. Read more
Source§impl<O, BC> BuildableCoreContext<BC> for Owhere
O: Default,
impl<O, BC> BuildableCoreContext<BC> for Owhere
O: Default,
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)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)Source§impl<CC, BC, Meta> RecvFrameContext<Meta, BC> for CCwhere
Meta: ReceivableFrameMeta<CC, BC>,
impl<CC, BC, Meta> RecvFrameContext<Meta, BC> for CCwhere
Meta: ReceivableFrameMeta<CC, BC>,
Source§impl<CC, BC, Meta> SendFrameContext<BC, Meta> for CCwhere
Meta: SendableFrameMeta<CC, BC>,
impl<CC, BC, Meta> SendFrameContext<BC, Meta> for CCwhere
Meta: SendableFrameMeta<CC, BC>,
Source§fn send_frame<S>(
&mut self,
bindings_ctx: &mut BC,
metadata: Meta,
frame: S,
) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, S>>where
S: Serializer,
<S as Serializer>::Buffer: BufferMut,
fn send_frame<S>(
&mut self,
bindings_ctx: &mut BC,
metadata: Meta,
frame: S,
) -> Result<(), ErrorAndSerializer<SendFrameErrorReason, S>>where
S: Serializer,
<S as Serializer>::Buffer: BufferMut,
Send a frame. Read more
Source§impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
BC: TimerBindingsTypes,
Id: HandleableTimer<CC, BC>,
impl<Id, CC, BC> TimerHandler<BC, Id> for CCwhere
BC: TimerBindingsTypes,
Id: HandleableTimer<CC, BC>,
Source§fn handle_timer(
&mut self,
bindings_ctx: &mut BC,
dispatch: Id,
timer: <BC as TimerBindingsTypes>::UniqueTimerId,
)
fn handle_timer( &mut self, bindings_ctx: &mut BC, dispatch: Id, timer: <BC as TimerBindingsTypes>::UniqueTimerId, )
Handle a timer firing. Read more