pub enum VectorizerValue {
Null,
Bool(bool),
Int(i64),
Float(f64),
Bytes(Arc<[u8]>),
Str(String),
Array(Vec<Value>),
Map(Vec<(Value, Value)>),
}Expand description
The wire value model (WIRE-002) — byte-compatible with the value models the family shipped before Thunder, by construction.
Map is an insertion-ordered pair list because keys may be any value.
Variants§
Null
SQL NULL / nil.
Bool(bool)
Int(i64)
Float(f64)
Bytes(Arc<[u8]>)
Raw bytes, refcounted. Emitted as MessagePack bin (WIRE-010); the legacy int-array form decodes too (WIRE-011).
The payload is Arc<[u8]> rather than Vec<u8> so a decoded value can
move into a product’s store, and a stored buffer can reach the encoder,
as a refcount bump instead of a memcpy — in both directions. With an
owned Vec, a server paid one full copy of the payload per read and per
write, worst exactly where a binary protocol is supposed to win: large
values and the raw-LE-f32 embeddings this wire exists to carry.
The wire is unchanged. The emitted form is still MessagePack bin
and the legacy int-array form is still accepted, so no corpus vector
moves and no other language lane is affected — only the Rust type.
Str(String)
Array(Vec<Value>)
Map(Vec<(Value, Value)>)
Implementations§
Source§impl Value
impl Value
The shared buffer behind Value::Bytes, for the zero-copy path.
Arc::clone on the result is a refcount bump: a product can put the
decoded payload straight into its store without copying it.
Consume the value and take its shared buffer — no copy, no refcount bump beyond the move itself.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Value
impl<'de> Deserialize<'de> for Value
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Value, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Value, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl From<Vec<u8>> for Value
impl From<Vec<u8>> for Value
Source§fn from(b: Vec<u8>) -> Value
fn from(b: Vec<u8>) -> Value
Copies once, at the boundary — use Value::from on an Arc<[u8]>
(or Value::bytes) when the caller already holds a shared buffer.