#[repr(C)]pub struct ShortFormat {
pub seconds: u16,
pub fraction: u16,
}Expand description
NTP Short Format - Used in delay and dispersion header fields where the full resolution and range of the other formats are not justified. It includes a 16-bit unsigned seconds field and a 16-bit fraction field.
§Layout
ⓘ
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Seconds | Fraction |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+Fields§
§seconds: u16§fraction: u16Trait Implementations§
Source§impl Clone for ShortFormat
impl Clone for ShortFormat
Source§fn clone(&self) -> ShortFormat
fn clone(&self) -> ShortFormat
Returns a duplicate 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 ConstPackedSizeBytes for ShortFormat
impl ConstPackedSizeBytes for ShortFormat
const PACKED_SIZE_BYTES: usize = 4
Source§impl Debug for ShortFormat
impl Debug for ShortFormat
Source§impl Default for ShortFormat
impl Default for ShortFormat
Source§fn default() -> ShortFormat
fn default() -> ShortFormat
Returns the “default value” for a type. Read more
Source§impl From<Instant> for ShortFormat
impl From<Instant> for ShortFormat
Source§impl From<ShortFormat> for Instant
impl From<ShortFormat> for Instant
Source§fn from(t: ShortFormat) -> Self
fn from(t: ShortFormat) -> Self
Converts to this type from the input type.
Source§impl Hash for ShortFormat
impl Hash for ShortFormat
Source§impl Ord for ShortFormat
impl Ord for ShortFormat
Source§fn cmp(&self, other: &ShortFormat) -> Ordering
fn cmp(&self, other: &ShortFormat) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for ShortFormat
impl PartialEq for ShortFormat
Source§impl PartialOrd for ShortFormat
impl PartialOrd for ShortFormat
Source§impl ReadFromBytes for ShortFormat
impl ReadFromBytes for ShortFormat
Source§fn read_from_bytes<R: ReadBytesExt>(reader: R) -> Result<Self>
fn read_from_bytes<R: ReadBytesExt>(reader: R) -> Result<Self>
Read the command from bytes.
Source§impl WriteToBytes for ShortFormat
impl WriteToBytes for ShortFormat
Source§fn write_to_bytes<W: WriteBytesExt>(&self, writer: W) -> Result<()>
fn write_to_bytes<W: WriteBytesExt>(&self, writer: W) -> Result<()>
Write the command to bytes.
impl Copy for ShortFormat
impl Eq for ShortFormat
impl StructuralPartialEq for ShortFormat
Auto Trait Implementations§
impl Freeze for ShortFormat
impl RefUnwindSafe for ShortFormat
impl Send for ShortFormat
impl Sync for ShortFormat
impl Unpin for ShortFormat
impl UnsafeUnpin for ShortFormat
impl UnwindSafe for ShortFormat
Blanket Implementations§
Source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
Source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Convert the given value into an approximately equivalent representation.
Source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
Source§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
The error type produced by a failed conversion.
Source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Convert the subject into an approximately equivalent representation.
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
Source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
Source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Approximate the subject to a given type with the default scheme.
Source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
Approximate the subject to a given type with a specific scheme.