pub enum Probed<T> {
Present {
value: T,
evidence: Evidence,
},
Absent {
reason: AbsenceReason,
},
NotProbed,
}Expand description
The outcome of one capability probe.
Present always carries the Evidence that justified the answer, so a
reader can audit why the agent believes a device exists. Absent carries
the AbsenceReason so a reader can tell “looked, not there” apart from
“advertised, but lied”. NotProbed is the only honest answer when the probe
has not run yet (e.g. a destructive probe deferred out of the runtime phase).
Variants§
Present
The capability is present; evidence records what proved it.
Absent
The capability is genuinely absent; reason records why we concluded so.
Fields
§
reason: AbsenceReasonNotProbed
The probe has not run (deferred, or this phase forbids it).
Implementations§
Source§impl<T> Probed<T>
impl<T> Probed<T>
Sourcepub fn is_present(&self) -> bool
pub fn is_present(&self) -> bool
True only for Probed::Present.
Sourcepub fn present(value: T, evidence: Evidence) -> Self
pub fn present(value: T, evidence: Evidence) -> Self
Construct a Present carrying its evidence.
Sourcepub fn absent(reason: AbsenceReason) -> Self
pub fn absent(reason: AbsenceReason) -> Self
Construct an Absent carrying its reason.
Trait Implementations§
Source§impl<'de, T> Deserialize<'de> for Probed<T>where
T: Deserialize<'de>,
impl<'de, T> Deserialize<'de> for Probed<T>where
T: Deserialize<'de>,
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl<T: Eq> Eq for Probed<T>
impl<T: PartialEq> StructuralPartialEq for Probed<T>
Auto Trait Implementations§
impl<T> Freeze for Probed<T>where
T: Freeze,
impl<T> RefUnwindSafe for Probed<T>where
T: RefUnwindSafe,
impl<T> Send for Probed<T>where
T: Send,
impl<T> Sync for Probed<T>where
T: Sync,
impl<T> Unpin for Probed<T>where
T: Unpin,
impl<T> UnsafeUnpin for Probed<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Probed<T>where
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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
Compare self to
key and return true if they are equal.