pub struct Icmpv4TimestampRequest(/* private fields */);
Expand description
An ICMPv4 Timestamp Request message.
Implementations§
Source§impl Icmpv4TimestampRequest
impl Icmpv4TimestampRequest
Sourcepub fn new(origin_timestamp: u32, id: u16, seq: u16) -> Icmpv4TimestampRequest
pub fn new(origin_timestamp: u32, id: u16, seq: u16) -> Icmpv4TimestampRequest
Creates an Icmpv4TimestampRequest
.
new
constructs a new Icmpv4TimestampRequest
with the given
parameters, and sets the Receive Timestamp and Transmit Timestamp values
to zero.
Sourcepub fn reply(
&self,
recv_timestamp: u32,
tx_timestamp: u32,
) -> Icmpv4TimestampReply
pub fn reply( &self, recv_timestamp: u32, tx_timestamp: u32, ) -> Icmpv4TimestampReply
Reply to a Timestamp Request message.
reply
takes the Icmpv4TimestampRequest
from a Timestamp Request
message, and produces the appropriate Icmpv4TimestampReply
value for a
Timestamp Reply message. The original Originate Timestamp, ICMP ID, and
ICMP Sequence Number are retained, while the Receive Timestamp and
Transmit Timestamp are overwritten with the given values.
The Receive Timestamp (recv_timestamp
) indicates the time at which the
Timestamp Request was first received, while the Transmit Timestamp
(tx_timestamp
) indicates the time at which the Timestamp Reply was
last processed before being sent.
Trait Implementations§
Source§impl Clone for Icmpv4TimestampRequest
impl Clone for Icmpv4TimestampRequest
Source§fn clone(&self) -> Icmpv4TimestampRequest
fn clone(&self) -> Icmpv4TimestampRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for Icmpv4TimestampRequest
impl Debug for Icmpv4TimestampRequest
Source§impl FromBytes for Icmpv4TimestampRequestwhere
Timestamp: FromBytes,
impl FromBytes for Icmpv4TimestampRequestwhere
Timestamp: FromBytes,
§fn ref_from_bytes(
source: &[u8],
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: KnownLayout + Immutable,
fn ref_from_bytes(
source: &[u8],
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: KnownLayout + Immutable,
§fn ref_from_prefix(
source: &[u8],
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: KnownLayout + Immutable,
fn ref_from_prefix(
source: &[u8],
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: KnownLayout + Immutable,
§fn ref_from_suffix(
source: &[u8],
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: Immutable + KnownLayout,
fn ref_from_suffix(
source: &[u8],
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, Infallible>>where
Self: Immutable + KnownLayout,
&Self
. Read more§fn mut_from_bytes(
source: &mut [u8],
) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
fn mut_from_bytes(
source: &mut [u8],
) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
§fn mut_from_prefix(
source: &mut [u8],
) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
fn mut_from_prefix(
source: &mut [u8],
) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
§fn mut_from_suffix(
source: &mut [u8],
) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
fn mut_from_suffix(
source: &mut [u8],
) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, Infallible>>where
Self: IntoBytes + KnownLayout,
Source§impl FromZeros for Icmpv4TimestampRequestwhere
Timestamp: FromZeros,
impl FromZeros for Icmpv4TimestampRequestwhere
Timestamp: FromZeros,
Source§impl IcmpMessage<Ipv4> for Icmpv4TimestampRequest
impl IcmpMessage<Ipv4> for Icmpv4TimestampRequest
Source§const EXPECTS_BODY: bool = false
const EXPECTS_BODY: bool = false
Source§const TYPE: <Ipv4 as IcmpIpExt>::IcmpMessageType = {transmute(0x06): <net_types::ip::Ipv4 as icmp::IcmpIpExt>::IcmpMessageType}
const TYPE: <Ipv4 as IcmpIpExt>::IcmpMessageType = {transmute(0x06): <net_types::ip::Ipv4 as icmp::IcmpIpExt>::IcmpMessageType}
Source§type Code = IcmpUnusedCode
type Code = IcmpUnusedCode
Source§type Body<B: SplitByteSlice> = EmptyMessage<B>
type Body<B: SplitByteSlice> = EmptyMessage<B>
Source§impl IntoBytes for Icmpv4TimestampRequestwhere
Timestamp: IntoBytes,
impl IntoBytes for Icmpv4TimestampRequestwhere
Timestamp: IntoBytes,
§fn as_mut_bytes(&mut self) -> &mut [u8] ⓘwhere
Self: FromBytes,
fn as_mut_bytes(&mut self) -> &mut [u8] ⓘwhere
Self: FromBytes,
§fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>where
Self: Immutable,
fn write_to(&self, dst: &mut [u8]) -> Result<(), SizeError<&Self, &mut [u8]>>where
Self: Immutable,
Source§impl KnownLayout for Icmpv4TimestampRequestwhere
Self: Sized,
impl KnownLayout for Icmpv4TimestampRequestwhere
Self: Sized,
Source§type PointerMetadata = ()
type PointerMetadata = ()
Self
. Read moreSource§impl TryFromBytes for Icmpv4TimestampRequestwhere
Timestamp: TryFromBytes,
impl TryFromBytes for Icmpv4TimestampRequestwhere
Timestamp: TryFromBytes,
§fn try_ref_from_bytes(
source: &[u8],
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
fn try_ref_from_bytes(
source: &[u8],
) -> Result<&Self, ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
§fn try_ref_from_prefix(
source: &[u8],
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
fn try_ref_from_prefix(
source: &[u8],
) -> Result<(&Self, &[u8]), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
§fn try_ref_from_suffix(
source: &[u8],
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
fn try_ref_from_suffix(
source: &[u8],
) -> Result<(&[u8], &Self), ConvertError<AlignmentError<&[u8], Self>, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: KnownLayout + Immutable,
§fn try_mut_from_bytes(
bytes: &mut [u8],
) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where
Self: KnownLayout,
fn try_mut_from_bytes(
bytes: &mut [u8],
) -> Result<&mut Self, ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where
Self: KnownLayout,
§fn try_mut_from_prefix(
source: &mut [u8],
) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where
Self: KnownLayout,
fn try_mut_from_prefix(
source: &mut [u8],
) -> Result<(&mut Self, &mut [u8]), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where
Self: KnownLayout,
§fn try_mut_from_suffix(
source: &mut [u8],
) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where
Self: KnownLayout,
fn try_mut_from_suffix(
source: &mut [u8],
) -> Result<(&mut [u8], &mut Self), ConvertError<AlignmentError<&mut [u8], Self>, SizeError<&mut [u8], Self>, ValidityError<&mut [u8], Self>>>where
Self: KnownLayout,
§fn try_read_from_bytes(
source: &[u8],
) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
fn try_read_from_bytes(
source: &[u8],
) -> Result<Self, ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
§fn try_read_from_prefix(
source: &[u8],
) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
fn try_read_from_prefix(
source: &[u8],
) -> Result<(Self, &[u8]), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
§fn try_read_from_suffix(
source: &[u8],
) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
fn try_read_from_suffix(
source: &[u8],
) -> Result<(&[u8], Self), ConvertError<Infallible, SizeError<&[u8], Self>, ValidityError<&[u8], Self>>>where
Self: Sized,
impl Copy for Icmpv4TimestampRequest
impl Immutable for Icmpv4TimestampRequestwhere
Timestamp: Immutable,
impl Unaligned for Icmpv4TimestampRequestwhere
Timestamp: Unaligned,
Auto Trait Implementations§
impl Freeze for Icmpv4TimestampRequest
impl RefUnwindSafe for Icmpv4TimestampRequest
impl Send for Icmpv4TimestampRequest
impl Sync for Icmpv4TimestampRequest
impl Unpin for Icmpv4TimestampRequest
impl UnwindSafe for Icmpv4TimestampRequest
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
)