Skip to main content

WireValue

Enum WireValue 

Source
pub enum WireValue {
Show 27 variants Null, Bool(bool), Number(f64), Integer(i64), I8(i8), U8(u8), I16(i16), U16(u16), I32(i32), U32(u32), I64(i64), U64(u64), Isize(i64), Usize(u64), Ptr(u64), F32(f32), String(String), Timestamp(i64), Duration { value: f64, unit: DurationUnit, }, Array(Vec<WireValue>), Object(BTreeMap<String, WireValue>), Table(WireTable), Result { ok: bool, value: Box<WireValue>, }, Range { start: Option<Box<WireValue>>, end: Option<Box<WireValue>>, inclusive: bool, }, FunctionRef { name: String, }, PrintResult(WirePrintResult), Content(ContentNode),
}
Expand description

The universal wire format for Shape values

This enum represents all Shape values in a serializable form. It is the core data structure exchanged between components.

Variants§

§

Null

Null/None value

§

Bool(bool)

Boolean value

§

Number(f64)

64-bit floating point number

§

Integer(i64)

64-bit signed integer

§

I8(i8)

8-bit signed integer (ABI-preserving native scalar)

§

U8(u8)

8-bit unsigned integer (ABI-preserving native scalar)

§

I16(i16)

16-bit signed integer (ABI-preserving native scalar)

§

U16(u16)

16-bit unsigned integer (ABI-preserving native scalar)

§

I32(i32)

32-bit signed integer (ABI-preserving native scalar)

§

U32(u32)

32-bit unsigned integer (ABI-preserving native scalar)

§

I64(i64)

64-bit signed integer (ABI-preserving native scalar)

§

U64(u64)

64-bit unsigned integer (ABI-preserving native scalar)

§

Isize(i64)

Pointer-width signed integer normalized to i64 for portability

§

Usize(u64)

Pointer-width unsigned integer normalized to u64 for portability

§

Ptr(u64)

C pointer value normalized to u64 for portability

§

F32(f32)

32-bit float (ABI-preserving native scalar)

§

String(String)

UTF-8 string

§

Timestamp(i64)

Timestamp as Unix milliseconds (UTC)

§

Duration

Duration with unit

Fields

§value: f64
§

Array(Vec<WireValue>)

Homogeneous array of values

§

Object(BTreeMap<String, WireValue>)

Object with string keys (ordered for deterministic serialization)

§

Table(WireTable)

Table data with Arrow IPC serialization

§

Result

Result type (Ok or Err)

Fields

§ok: bool
§

Range

Range value

Fields

§inclusive: bool
§

FunctionRef

Function reference (name only, not callable)

Fields

§name: String
§

PrintResult(WirePrintResult)

Print result with structured spans

§

Content(ContentNode)

Structured content node for rich rendering

Implementations§

Source§

impl WireValue

Source

pub fn null() -> Self

Create a null value

Source

pub fn is_null(&self) -> bool

Check if this value is null

Source

pub fn as_number(&self) -> Option<f64>

Try to get this value as a number

Source

pub fn as_str(&self) -> Option<&str>

Try to get this value as a string

Source

pub fn as_bool(&self) -> Option<bool>

Try to get this value as a boolean

Source

pub fn type_name(&self) -> &'static str

Get the type name for display purposes

Trait Implementations§

Source§

impl Clone for WireValue

Source§

fn clone(&self) -> WireValue

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WireValue

Source§

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

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

impl<'de> Deserialize<'de> for WireValue

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 From<&Value> for WireValue

Source§

fn from(json: &Value) -> Self

Converts to this type from the input type.
Source§

impl From<&str> for WireValue

Source§

fn from(s: &str) -> Self

Converts to this type from the input type.
Source§

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

Source§

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

Converts to this type from the input type.
Source§

impl From<String> for WireValue

Source§

fn from(s: String) -> Self

Converts to this type from the input type.
Source§

impl From<Value> for WireValue

Convert from serde_json::Value to WireValue

This allows creating envelopes from JSON values for display purposes. Note: This conversion is lossy - JSON doesn’t have type information for things like Timestamp vs Integer, so we use heuristics.

Source§

fn from(json: Value) -> Self

Converts to this type from the input type.
Source§

impl<T: Into<WireValue>> From<Vec<T>> for WireValue

Source§

fn from(v: Vec<T>) -> Self

Converts to this type from the input type.
Source§

impl From<bool> for WireValue

Source§

fn from(b: bool) -> Self

Converts to this type from the input type.
Source§

impl From<f32> for WireValue

Source§

fn from(n: f32) -> Self

Converts to this type from the input type.
Source§

impl From<f64> for WireValue

Source§

fn from(n: f64) -> Self

Converts to this type from the input type.
Source§

impl From<i16> for WireValue

Source§

fn from(n: i16) -> Self

Converts to this type from the input type.
Source§

impl From<i32> for WireValue

Source§

fn from(n: i32) -> Self

Converts to this type from the input type.
Source§

impl From<i64> for WireValue

Source§

fn from(n: i64) -> Self

Converts to this type from the input type.
Source§

impl From<i8> for WireValue

Source§

fn from(n: i8) -> Self

Converts to this type from the input type.
Source§

impl From<u16> for WireValue

Source§

fn from(n: u16) -> Self

Converts to this type from the input type.
Source§

impl From<u32> for WireValue

Source§

fn from(n: u32) -> Self

Converts to this type from the input type.
Source§

impl From<u64> for WireValue

Source§

fn from(n: u64) -> Self

Converts to this type from the input type.
Source§

impl From<u8> for WireValue

Source§

fn from(n: u8) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for WireValue

Source§

fn eq(&self, other: &WireValue) -> 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 WireValue

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 StructuralPartialEq for WireValue

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 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> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

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