pub enum CellValue {
Num(u64),
Bool(bool),
Text(String),
Date(i64),
Err(u8),
}Expand description
The dataflow encoding of a cell value.
Differential-dataflow data must be Ord + Eq + Hash + Clone + 'static and
exchange-safe. f64 is none of the first three, so numbers ride as their
bit pattern; the other variants make Text / Boolean / Error first-class in
the dataflow (the non-numeric value lane). Numbers stay the fast path.
Variants§
Num(u64)
A number, as f64::to_bits() (total order via f64::total_cmp at the
boundary; bit order is fine for equality/hashing/exchange).
Bool(bool)
Text(String)
Date(i64)
A UTC timestamp as milliseconds since the Unix epoch. i64 keeps the
value totally-ordered/Hash/Ord for the DD lane (unlike a chrono
DateTime, which is fine but this avoids a chrono dep in the key type).
Err(u8)
An error value; the u8 is the ValueError kind discriminant so error
cells are distinguishable and propagate through operators.
Implementations§
Source§impl CellValue
impl CellValue
Sourcepub fn from_bool_numeric(b: bool) -> Self
pub fn from_bool_numeric(b: bool) -> Self
Encode a boolean as the numeric-lane 1.0/0.0 (back-compat with the comparison/logical convention) — used where downstream expects a number.
Sourcepub fn from_model_value(v: &Value) -> Option<CellValue>
pub fn from_model_value(v: &Value) -> Option<CellValue>
Convert a model Value into a CellValue for feeding inputs.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CellValue
impl<'de> Deserialize<'de> for CellValue
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>,
impl Eq for CellValue
Source§impl Ord for CellValue
impl Ord for CellValue
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for CellValue
impl PartialOrd for CellValue
impl StructuralPartialEq for CellValue
Auto Trait Implementations§
impl Freeze for CellValue
impl RefUnwindSafe for CellValue
impl Send for CellValue
impl Sync for CellValue
impl Unpin for CellValue
impl UnsafeUnpin for CellValue
impl UnwindSafe for CellValue
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
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,
impl<T> Data for T
impl<T> Data for Twhere
T: Clone + 'static,
impl<T> Data for T
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
impl<T> ExchangeData for T
impl<T> ExchangeData for Twhere
T: Data + Data,
§impl<T> PreferredContainer for T
impl<T> PreferredContainer for T
§impl<T> ProgressEventTimestamp for T
impl<T> ProgressEventTimestamp for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
impl<'a, S, T> Semigroup<&'a S> for Twhere
T: Semigroup<S>,
§fn plus_equals(&mut self, rhs: &&'a S)
fn plus_equals(&mut self, rhs: &&'a S)
std::ops::AddAssign, for types that do not implement AddAssign.