JsonEncodedESExpr

Enum JsonEncodedESExpr 

Source
pub enum JsonEncodedESExpr {
Show 16 variants Constructor { constructor_name: String, args: Option<Vec<JsonEncodedESExpr>>, kwargs: Option<BTreeMap<String, JsonEncodedESExpr>>, }, List(Vec<JsonEncodedESExpr>), Bool(bool), Int { int: BigInt, }, Str(String), BinaryBase64 { base64: Base64Value, }, Array8 { array8: Vec<u8>, }, Array16 { array16: Vec<u16>, }, Array32 { array32: Vec<u32>, }, Array64 { array64: Vec<u64>, }, Array128 { array128: Vec<u128>, }, Float16 { float16: f16, }, Float32 { float32: f32, }, Float64 { float64: f64, }, Null(()), NullLevel { null: BigUint, },
}
Expand description

Represents an ESExpr encoded as JSON with type information

Variants§

§

Constructor

A constructor with a name and optional arguments

Fields

§constructor_name: String

The name of the constructor

§args: Option<Vec<JsonEncodedESExpr>>

The positional arguments

§kwargs: Option<BTreeMap<String, JsonEncodedESExpr>>

The keyword arguments

§

List(Vec<JsonEncodedESExpr>)

A list of expressions

§

Bool(bool)

A bool value

§

Int

An arbitrary-precision integer

Fields

§int: BigInt

The integer value

§

Str(String)

A string value

§

BinaryBase64

Binary data encoded as base64

Fields

§base64: Base64Value

The base64 encoded data

§

Array8

An array of 8-bit values.

Fields

§array8: Vec<u8>

The 8-bit values encoded as uint8.

§

Array16

An array of 16-bit values.

Fields

§array16: Vec<u16>

The 16-bit values encoded as uint16.

§

Array32

An array of 32-bit values.

Fields

§array32: Vec<u32>

The 32-bit values encoded as uint32.

§

Array64

An array of 64-bit values.

Fields

§array64: Vec<u64>

The 64-bit values encoded as uint64.

§

Array128

An array of 128-bit values.

Fields

§array128: Vec<u128>

The 128-bit values encoded as uint128.

§

Float16

A 16-bit floating point number

Fields

§float16: f16

The float32 value

§

Float32

A 32-bit floating point number

Fields

§float32: f32

The float32 value

§

Float64

A 64-bit floating point number

Fields

§float64: f64

The float64 value

§

Null(())

A null value

§

NullLevel

A null value with a level

Fields

§null: BigUint

The level of the null value

Implementations§

Source§

impl JsonEncodedESExpr

Source

pub fn from_esexpr(expr: ESExpr<'_>) -> Self

Converts an ESExpr into a JsonEncodedESExpr

Source

pub fn into_esexpr(self) -> ESExpr<'static>

Converts a JsonEncodedESExpr into an ESExpr

Trait Implementations§

Source§

impl Debug for JsonEncodedESExpr

Source§

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

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

impl<'de> Deserialize<'de> for JsonEncodedESExpr

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 PartialEq for JsonEncodedESExpr

Source§

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

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 JsonEncodedESExpr

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> 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, 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>,