pub enum VectorizerValue {
Null,
Bool(bool),
Int(i64),
Float(f64),
Bytes(Vec<u8>),
Str(String),
Array(Vec<VectorizerValue>),
Map(Vec<(VectorizerValue, VectorizerValue)>),
}Expand description
A dynamically-typed value that can cross the VectorizerRPC wire.
Encoded with rmp-serde’s default externally-tagged representation:
unit variants become a bare string ("Null"), newtype variants
become a single-key map ({"Int": 42}). Cross-language mapping is
documented at wire spec § 3.
Variants§
Null
SQL NULL / absence of a value.
Bool(bool)
Boolean.
Int(i64)
64-bit signed integer.
Float(f64)
64-bit IEEE 754 float.
Bytes(Vec<u8>)
Raw bytes — stored without base64 (unlike the JSON transports).
Str(String)
UTF-8 string.
Array(Vec<VectorizerValue>)
Heterogeneous array.
Map(Vec<(VectorizerValue, VectorizerValue)>)
Ordered map of (key, value) pairs. Vec preserves insertion
order and allows non-string keys, matching MessagePack maps.
Implementations§
Source§impl VectorizerValue
impl VectorizerValue
Sourcepub fn as_float(&self) -> Option<f64>
pub fn as_float(&self) -> Option<f64>
Read as f64 if the variant is Float (or coerce from Int).
Sourcepub fn as_array(&self) -> Option<&[VectorizerValue]>
pub fn as_array(&self) -> Option<&[VectorizerValue]>
Borrow as an array if the variant is Array.
Sourcepub fn as_map(&self) -> Option<&[(VectorizerValue, VectorizerValue)]>
pub fn as_map(&self) -> Option<&[(VectorizerValue, VectorizerValue)]>
Borrow as a map’s (k, v) pairs if the variant is Map.
Sourcepub fn map_get(&self, key: &str) -> Option<&VectorizerValue>
pub fn map_get(&self, key: &str) -> Option<&VectorizerValue>
Look up a string-keyed map entry. Returns None if self is
not a Map or if the key is missing.
Trait Implementations§
Source§impl Clone for VectorizerValue
impl Clone for VectorizerValue
Source§fn clone(&self) -> VectorizerValue
fn clone(&self) -> VectorizerValue
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for VectorizerValue
impl Debug for VectorizerValue
Source§impl<'de> Deserialize<'de> for VectorizerValue
impl<'de> Deserialize<'de> for VectorizerValue
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<VectorizerValue, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<VectorizerValue, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl From<&str> for VectorizerValue
impl From<&str> for VectorizerValue
Source§fn from(s: &str) -> VectorizerValue
fn from(s: &str) -> VectorizerValue
Source§impl From<String> for VectorizerValue
impl From<String> for VectorizerValue
Source§fn from(s: String) -> VectorizerValue
fn from(s: String) -> VectorizerValue
Source§impl From<bool> for VectorizerValue
impl From<bool> for VectorizerValue
Source§fn from(b: bool) -> VectorizerValue
fn from(b: bool) -> VectorizerValue
Source§impl From<i64> for VectorizerValue
impl From<i64> for VectorizerValue
Source§fn from(i: i64) -> VectorizerValue
fn from(i: i64) -> VectorizerValue
Source§impl PartialEq for VectorizerValue
impl PartialEq for VectorizerValue
Source§impl Serialize for VectorizerValue
impl Serialize for VectorizerValue
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for VectorizerValue
Auto Trait Implementations§
impl Freeze for VectorizerValue
impl RefUnwindSafe for VectorizerValue
impl Send for VectorizerValue
impl Sync for VectorizerValue
impl Unpin for VectorizerValue
impl UnsafeUnpin for VectorizerValue
impl UnwindSafe for VectorizerValue
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request