#[non_exhaustive]pub enum DetectorOutput {
Bool(bool),
Text(String),
Number(f64),
Score(f32),
None,
}Expand description
What a detector produced this tick.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Bool(bool)
Gates and presence checks. Bool(false) means “no match” / “gate closed”.
Text(String)
OCR’d text.
Number(f64)
A parsed numeric value (HP, gold, timer).
Must never be NaN: change detection compares outputs with PartialEq,
and NaN != NaN would fire a spurious change event every tick. Detectors
that fail to parse a number must return None or an Err instead.
Score(f32)
A template-match confidence score in 0.0..=1.0. Must never be NaN
(same rule as Number).
None
Nothing detected this tick.
Implementations§
Trait Implementations§
Source§impl Clone for DetectorOutput
impl Clone for DetectorOutput
Source§fn clone(&self) -> DetectorOutput
fn clone(&self) -> DetectorOutput
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DetectorOutput
impl Debug for DetectorOutput
Source§impl PartialEq for DetectorOutput
impl PartialEq for DetectorOutput
Source§fn eq(&self, other: &DetectorOutput) -> bool
fn eq(&self, other: &DetectorOutput) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DetectorOutput
Auto Trait Implementations§
impl Freeze for DetectorOutput
impl RefUnwindSafe for DetectorOutput
impl Send for DetectorOutput
impl Sync for DetectorOutput
impl Unpin for DetectorOutput
impl UnsafeUnpin for DetectorOutput
impl UnwindSafe for DetectorOutput
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