pub enum BinaryValue {
Int(i64),
Float(f64),
Bool(bool),
String(String),
StringArray(Vec<String>),
NestedRecord(Box<LnmpRecord>),
NestedArray(Vec<LnmpRecord>),
Embedding(Vector),
QuantizedEmbedding(QuantizedVector),
}Expand description
Binary value representation for LNMP v0.4/v0.5
Variants§
Int(i64)
Integer value (i64)
Float(f64)
Floating-point value (f64)
Bool(bool)
Boolean value
String(String)
String value
StringArray(Vec<String>)
Array of strings
NestedRecord(Box<LnmpRecord>)
Nested record (v0.5)
NestedArray(Vec<LnmpRecord>)
Array of nested records (v0.5)
Embedding(Vector)
Embedding (v0.5)
QuantizedEmbedding(QuantizedVector)
Quantized embedding (v0.5.2)
Implementations§
Source§impl BinaryValue
impl BinaryValue
Sourcepub fn from_lnmp_value(value: &LnmpValue) -> Result<Self, BinaryError>
pub fn from_lnmp_value(value: &LnmpValue) -> Result<Self, BinaryError>
Converts from LnmpValue to BinaryValue
In v0.5, nested structures are supported. Use from_lnmp_value_v0_4 for v0.4 compatibility.
Sourcepub fn from_lnmp_value_v0_4(value: &LnmpValue) -> Result<Self, BinaryError>
pub fn from_lnmp_value_v0_4(value: &LnmpValue) -> Result<Self, BinaryError>
Converts from LnmpValue to BinaryValue (v0.4 compatibility mode)
Returns an error if the value contains nested structures (not supported in v0.4)
Sourcepub fn to_lnmp_value(&self) -> LnmpValue
pub fn to_lnmp_value(&self) -> LnmpValue
Converts to LnmpValue
Trait Implementations§
Source§impl Clone for BinaryValue
impl Clone for BinaryValue
Source§fn clone(&self) -> BinaryValue
fn clone(&self) -> BinaryValue
Returns a duplicate of the value. Read more
1.0.0 · 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 BinaryValue
impl Debug for BinaryValue
Source§impl PartialEq for BinaryValue
impl PartialEq for BinaryValue
impl StructuralPartialEq for BinaryValue
Auto Trait Implementations§
impl Freeze for BinaryValue
impl RefUnwindSafe for BinaryValue
impl Send for BinaryValue
impl Sync for BinaryValue
impl Unpin for BinaryValue
impl UnwindSafe for BinaryValue
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