pub enum Asked<T> {
NotAsked,
Asked(T),
}Expand description
“Was the question even put?” — the RFC 09 §5.1 O4 split (#246 / P1), made nominal (RFC 13, v1.24).
A generation of report fields spelled “not asked” as Option::None,
which conflated it with every other absence the moment a field also had
an asked-but-absent reading. This type carries exactly the not-asked
distinction and nothing else:
Asked::NotAsked— the flag was not passed, the sweep was not made, the question does not exist for this subject. On the wire it is absence (the field carriesskip_serializing_if+default), byte-identical to theOptionit replaced.Asked::Asked— the question was put; the payload is the answer, serialized transparently (again exactly asSomedid).
The split is the point: a field whose None means asked and nothing
was there (an unstamped sample’s age, a producer with no served slice)
stays Option — wrapping it here would re-conflate in the other
direction.
Variants§
NotAsked
The question was not put. Serializes as absence — not zero, not null,
not [] (RFC 09 §5.1 O4).
Asked(T)
The question was put, and this is what came back — an empty answer
(Asked(vec![]), Asked(0)) is a real answer, distinct from
NotAsked on the wire and in the type.
Implementations§
Trait Implementations§
impl<T: Copy> Copy for Asked<T>
impl<T: Eq> Eq for Asked<T>
Source§impl<T> From<Option<T>> for Asked<T>
Option’s not-asked reading, named: None → NotAsked, Some →
Asked — the mechanical migration step for gated facts built with
flag.then(...).
impl<T> From<Option<T>> for Asked<T>
Option’s not-asked reading, named: None → NotAsked, Some →
Asked — the mechanical migration step for gated facts built with
flag.then(...).
impl<T: PartialEq> StructuralPartialEq for Asked<T>
Auto Trait Implementations§
impl<T> Freeze for Asked<T>where
T: Freeze,
impl<T> RefUnwindSafe for Asked<T>where
T: RefUnwindSafe,
impl<T> Send for Asked<T>where
T: Send,
impl<T> Sync for Asked<T>where
T: Sync,
impl<T> Unpin for Asked<T>where
T: Unpin,
impl<T> UnsafeUnpin for Asked<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Asked<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<Source> AccessAs for Source
impl<Source> AccessAs for Source
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more