Value

Enum Value 

Source
pub enum Value {
Show 53 variants Null, True, False, BF16(bf16), F16(f16), F32(f32), F64(f64), F128, I8(i8), I16(i16), I32(i32), I64(i64), I128(i128), U8(u8), U16(u16), U32(u32), U64(u64), U128(u128), String(Vec<u8>), StringObject(Vec<(Vec<u8>, Value)>), I8Object(Vec<(i8, Value)>), I16Object(Vec<(i16, Value)>), I32Object(Vec<(i32, Value)>), I64Object(Vec<(i64, Value)>), I128Object(Vec<(i128, Value)>), U8Object(Vec<(u8, Value)>), U16Object(Vec<(u16, Value)>), U32Object(Vec<(u32, Value)>), U64Object(Vec<(u64, Value)>), U128Object(Vec<(u128, Value)>), BF16Array(Vec<bf16>), F16Array(Vec<f16>), F32Array(Vec<f32>), F64Array(Vec<f64>), F128Array, I8Array(Vec<i8>), I16Array(Vec<i16>), I32Array(Vec<i32>), I64Array(Vec<i64>), I128Array(Vec<i128>), U8Array(Vec<u8>), U16Array(Vec<u16>), U32Array(Vec<u32>), U64Array(Vec<u64>), U128Array(Vec<u128>), BoolArray(usize, Vec<u8>), StringArray(Vec<Vec<u8>>), GenericArray(Vec<Value>), Delimiter, Tag(usize, Box<Value>), Matrix { layout: MatrixLayout, extents: Box<Value>, value: Box<Value>, }, Complex(ComplexNumber), Reserved,
}
Expand description

An intermediate representation of values used during serialization.

This is a nearly 1:1 mapping to the HEADER | VALUE format in which BEVE values are encoded.

Objects are represented as a vector of key-value pairs, and strings are represented as their bytes.

Variants§

§

Null

§

True

§

False

§

BF16(bf16)

When the half feature is disabled, this variant will carry no payload.
§

F16(f16)

When the half feature is disabled, this variant will carry no payload.
§

F32(f32)

§

F64(f64)

§

F128

§

I8(i8)

§

I16(i16)

§

I32(i32)

§

I64(i64)

§

I128(i128)

§

U8(u8)

§

U16(u16)

§

U32(u32)

§

U64(u64)

§

U128(u128)

§

String(Vec<u8>)

§

StringObject(Vec<(Vec<u8>, Value)>)

§

I8Object(Vec<(i8, Value)>)

§

I16Object(Vec<(i16, Value)>)

§

I32Object(Vec<(i32, Value)>)

§

I64Object(Vec<(i64, Value)>)

§

I128Object(Vec<(i128, Value)>)

§

U8Object(Vec<(u8, Value)>)

§

U16Object(Vec<(u16, Value)>)

§

U32Object(Vec<(u32, Value)>)

§

U64Object(Vec<(u64, Value)>)

§

U128Object(Vec<(u128, Value)>)

§

BF16Array(Vec<bf16>)

§

F16Array(Vec<f16>)

§

F32Array(Vec<f32>)

§

F64Array(Vec<f64>)

§

F128Array

§

I8Array(Vec<i8>)

§

I16Array(Vec<i16>)

§

I32Array(Vec<i32>)

§

I64Array(Vec<i64>)

§

I128Array(Vec<i128>)

§

U8Array(Vec<u8>)

§

U16Array(Vec<u16>)

§

U32Array(Vec<u32>)

§

U64Array(Vec<u64>)

§

U128Array(Vec<u128>)

§

BoolArray(usize, Vec<u8>)

Note that field 1 contains u8s rather than bools. This is because it is meant to be written directly to a writer during serialization, where each bit within each byte represents a true or false value.

§

StringArray(Vec<Vec<u8>>)

§

GenericArray(Vec<Value>)

§

Delimiter

§

Tag(usize, Box<Value>)

§

Matrix

Fields

§extents: Box<Value>

Must be a typed array of integers.

§value: Box<Value>

Must be a typed array of numbers.

§

Complex(ComplexNumber)

§

Reserved

Implementations§

Source§

impl Value

Source

pub fn header(&self) -> u8

Trait Implementations§

Source§

impl Debug for Value

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Value

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Value

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<&Value> for ArrayKind

Source§

fn from(value: &Value) -> Self

Converts to this type from the input type.
Source§

impl From<&str> for Value

Source§

fn from(value: &str) -> Self

Converts to this type from the input type.
Source§

impl From<()> for Value

Source§

fn from(_value: ()) -> Self

Converts to this type from the input type.
Source§

impl<T: Into<Value>> From<HashMap<&str, T>> for Value

Source§

fn from(value: HashMap<&str, T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Into<Value>> From<HashMap<String, T>> for Value

Source§

fn from(value: HashMap<String, T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Into<Value>> From<HashMap<i128, T>> for Value

Source§

fn from(value: HashMap<i128, T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Into<Value>> From<HashMap<i16, T>> for Value

Source§

fn from(value: HashMap<i16, T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Into<Value>> From<HashMap<i32, T>> for Value

Source§

fn from(value: HashMap<i32, T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Into<Value>> From<HashMap<i64, T>> for Value

Source§

fn from(value: HashMap<i64, T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Into<Value>> From<HashMap<i8, T>> for Value

Source§

fn from(value: HashMap<i8, T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Into<Value>> From<HashMap<u128, T>> for Value

Source§

fn from(value: HashMap<u128, T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Into<Value>> From<HashMap<u16, T>> for Value

Source§

fn from(value: HashMap<u16, T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Into<Value>> From<HashMap<u32, T>> for Value

Source§

fn from(value: HashMap<u32, T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Into<Value>> From<HashMap<u64, T>> for Value

Source§

fn from(value: HashMap<u64, T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Into<Value>> From<HashMap<u8, T>> for Value

Source§

fn from(value: HashMap<u8, T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Into<Value>> From<Option<T>> for Value

Source§

fn from(value: Option<T>) -> Self

Converts to this type from the input type.
Source§

impl From<String> for Value

Source§

fn from(value: String) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<&str>> for Value

Source§

fn from(value: Vec<&str>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<String>> for Value

Source§

fn from(value: Vec<String>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<bf16>> for Value

Source§

fn from(value: Vec<bf16>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<bool>> for Value

Source§

fn from(value: Vec<bool>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<f16>> for Value

Source§

fn from(value: Vec<f16>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<f32>> for Value

Source§

fn from(value: Vec<f32>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<f64>> for Value

Source§

fn from(value: Vec<f64>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<i128>> for Value

Source§

fn from(value: Vec<i128>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<i16>> for Value

Source§

fn from(value: Vec<i16>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<i32>> for Value

Source§

fn from(value: Vec<i32>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<i64>> for Value

Source§

fn from(value: Vec<i64>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<i8>> for Value

Source§

fn from(value: Vec<i8>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<u128>> for Value

Source§

fn from(value: Vec<u128>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<u16>> for Value

Source§

fn from(value: Vec<u16>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<u32>> for Value

Source§

fn from(value: Vec<u32>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<u64>> for Value

Source§

fn from(value: Vec<u64>) -> Self

Converts to this type from the input type.
Source§

impl From<Vec<u8>> for Value

Source§

fn from(value: Vec<u8>) -> Self

Converts to this type from the input type.
Source§

impl From<bf16> for Value

Source§

fn from(value: bf16) -> Self

Converts to this type from the input type.
Source§

impl From<bool> for Value

Source§

fn from(value: bool) -> Self

Converts to this type from the input type.
Source§

impl From<f16> for Value

Source§

fn from(value: f16) -> Self

Converts to this type from the input type.
Source§

impl From<f32> for Value

Source§

fn from(value: f32) -> Self

Converts to this type from the input type.
Source§

impl From<f64> for Value

Source§

fn from(value: f64) -> Self

Converts to this type from the input type.
Source§

impl From<i128> for Value

Source§

fn from(value: i128) -> Self

Converts to this type from the input type.
Source§

impl From<i16> for Value

Source§

fn from(value: i16) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for Value

Source§

fn from(value: i32) -> Self

Converts to this type from the input type.
Source§

impl From<i64> for Value

Source§

fn from(value: i64) -> Self

Converts to this type from the input type.
Source§

impl From<i8> for Value

Source§

fn from(value: i8) -> Self

Converts to this type from the input type.
Source§

impl From<u128> for Value

Source§

fn from(value: u128) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for Value

Source§

fn from(value: u16) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for Value

Source§

fn from(value: u32) -> Self

Converts to this type from the input type.
Source§

impl From<u64> for Value

Source§

fn from(value: u64) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for Value

Source§

fn from(value: u8) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for Value

Source§

fn eq(&self, other: &Value) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for Value

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl TryFrom<&Value> for ObjectKind

Source§

type Error = Error

The type returned in the event of a conversion error.
Source§

fn try_from(value: &Value) -> Result<Self, Self::Error>

Performs the conversion.
Source§

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 UnwindSafe for Value

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,