pub struct Nullable<T>(pub Option<T>);Expand description
A field that may be TLV null — §7.12’s X quality.
Distinct from Option<T> on purpose. Option<T> is a field that may be absent, and a
field can be both: Option<Nullable<T>> says “may be missing, and if present may be null”,
which is three states the specification really does distinguish. Collapsing them loses the
difference between “the device does not implement this” and “the device implements it and
has no value” — which is exactly the difference between §11.12.5.6’s null
OffPremiseServicesReachableIPv4 and its absence.
Tuple Fields§
§0: Option<T>Implementations§
Trait Implementations§
impl<T: Copy> Copy for Nullable<T>
impl<T: Eq> Eq for Nullable<T>
Source§impl<T: Ord> Ord for Nullable<T>
impl<T: Ord> Ord for Nullable<T>
1.21.0 (const: unstable) · 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
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
Source§impl<T: PartialOrd> PartialOrd for Nullable<T>
impl<T: PartialOrd> PartialOrd for Nullable<T>
impl<T: PartialEq> StructuralPartialEq for Nullable<T>
Auto Trait Implementations§
impl<T> Forget for Nullable<T>
impl<T> Freeze for Nullable<T>
impl<T> Move for Nullable<T>
impl<T> RefUnwindSafe for Nullable<T>where
Option<T>: RefUnwindSafe,
impl<T> Send for Nullable<T>
impl<T> Sync for Nullable<T>
impl<T> Unpin for Nullable<T>
impl<T> UnsafeUnpin for Nullable<T>where
Option<T>: UnsafeUnpin,
impl<T> UnwindSafe for Nullable<T>where
Option<T>: 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