pub enum FieldValue {
Number(f64),
Text(String),
OrderedList(Vec<String>),
TimestampSeconds(i64),
Bool(bool),
Null,
}Expand description
One observed field value.
Covers the four kinds of fields the detector reasons about: numeric (price/outlier), string (cardinality), ordered list (listing-reorder), and timestamp (staleness).
Variants§
Number(f64)
Numeric value (price, count, score, etc.).
Text(String)
String value (sku, title, status, etc.).
OrderedList(Vec<String>)
Ordered list of strings (a page of listings, a search result set, etc.). Used for listing-reorder detection.
TimestampSeconds(i64)
Timestamp value (published_at, expires_at, etc.). Stored as
seconds since the Unix epoch for portability.
Bool(bool)
Boolean value.
Null
Null / absent — explicitly recorded so the detector can distinguish “field missing” from “field present with empty value”.
Implementations§
Source§impl FieldValue
impl FieldValue
Sourcepub const fn is_ordered_list(&self) -> bool
pub const fn is_ordered_list(&self) -> bool
true if the value is an ordered list of strings.
Sourcepub const fn is_timestamp(&self) -> bool
pub const fn is_timestamp(&self) -> bool
true if the value is a timestamp.
Trait Implementations§
Source§impl Clone for FieldValue
impl Clone for FieldValue
Source§fn clone(&self) -> FieldValue
fn clone(&self) -> FieldValue
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 FieldValue
impl Debug for FieldValue
Source§impl<'de> Deserialize<'de> for FieldValue
impl<'de> Deserialize<'de> for FieldValue
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
Source§impl PartialEq for FieldValue
impl PartialEq for FieldValue
Source§fn eq(&self, other: &FieldValue) -> bool
fn eq(&self, other: &FieldValue) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for FieldValue
impl Serialize for FieldValue
impl StructuralPartialEq for FieldValue
Auto Trait Implementations§
impl Freeze for FieldValue
impl RefUnwindSafe for FieldValue
impl Send for FieldValue
impl Sync for FieldValue
impl Unpin for FieldValue
impl UnsafeUnpin for FieldValue
impl UnwindSafe for FieldValue
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