pub enum Value {
Null,
Bool(bool),
Number(Number),
String(String),
Nested(Box<Value>),
}Expand description
A single tabular cell value.
Scalars (Null/Bool/Number/String) diff by content. Nested holds a
canonicalized object/array (object keys sorted recursively) and participates
in diffs by equality only — a changed nested cell is reported as a cell edit,
but binoc does not recurse into it (see the typed-record ADR). String cells
are the all-untyped case used by CSV and other typeless sources.
Variants§
Implementations§
Source§impl Value
impl Value
Sourcepub fn from_json(value: Value) -> Self
pub fn from_json(value: Value) -> Self
Build a cell value from arbitrary JSON, canonicalizing nested containers so that equality is order-independent.
Sourcepub fn to_json(&self) -> Value
pub fn to_json(&self) -> Value
The JSON representation of this cell, used when building edit params.
Sourcepub fn as_text(&self) -> Cow<'_, str>
pub fn as_text(&self) -> Cow<'_, str>
A flat textual rendering for tokenization, CSV serialization, and scoring.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Value
impl StructuralPartialEq for Value
Auto Trait Implementations§
impl Freeze for Value
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnsafeUnpin for Value
impl UnwindSafe for Value
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