Home
runx-contracts

runx_contracts::json

Boundary JSON model: deterministic value, object, and number types for cross-language contracts.

Boundary JSON model: deterministic value, object, and number types for cross-language contracts.

Enums §

JsonValue §

pub enum runx_contracts::json::JsonValue { /* ... */ }

Implementations §

impl JsonValue

as_object

fn as_object(self: &Self) -> Option<&JsonObject>
#[must_use]

as_str

fn as_str(self: &Self) -> Option<&str>
#[must_use]

as_bool

fn as_bool(self: &Self) -> Option<bool>
#[must_use]

as_array

fn as_array(self: &Self) -> Option<&Vec<JsonValue>>
#[must_use]

Trait Implementations §

impl Borrow for JsonValue

borrow

fn borrow(self: &Self) -> &T

impl BorrowMut for JsonValue

borrow_mut

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

impl CloneToUninit for JsonValue

clone_to_uninit

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

impl Into for JsonValue

into

fn into(self: Self) -> U

Calls U::from(self).

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

impl From for JsonValue

from

fn from(t: T) -> T

Returns the argument unchanged.

impl TryInto for JsonValue

Error

try_into

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

impl TryFrom for JsonValue

Error

try_from

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

impl Any for JsonValue

type_id

fn type_id(self: &Self) -> TypeId

impl ToOwned for JsonValue

Owned

to_owned

fn to_owned(self: &Self) -> T

clone_into

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

impl Same for JsonValue

Output

impl RunxSchema for JsonValue

json_schema

fn json_schema() -> Value

impl Clone for JsonValue

clone

fn clone(self: &Self) -> JsonValue

impl Debug for JsonValue

impl PartialEq for JsonValue

eq

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

impl Serialize for JsonValue

serialize

fn serialize( self: &Self, __serializer: __S ) -> _serde::__private228::Result<<__S as >::Ok, <__S as >::Error>

impl Deserialize for JsonValue

deserialize

fn deserialize(__deserializer: __D) -> _serde::__private228::Result<Self, <__D as >::Error>

impl Send for JsonValue

impl Sync for JsonValue

impl Freeze for JsonValue

impl UnsafeUnpin for JsonValue

impl Unpin for JsonValue

impl UnwindSafe for JsonValue

impl RefUnwindSafe for JsonValue

impl DeserializeOwned for JsonValue

impl StructuralPartialEq for JsonValue

JsonNumber §

pub enum runx_contracts::json::JsonNumber { /* ... */ }

Strict JSON number representation for public serde boundaries.

Public serialization rejects non-finite floats. Act assignment idempotency hashing deliberately uses a separate JSON.stringify-compatible writer that hashes non-finite floats as null.

Implementations §

impl JsonNumber

as_f64

fn as_f64(self: &Self) -> Option<f64>
#[must_use]

Trait Implementations §

impl Borrow for JsonNumber

borrow

fn borrow(self: &Self) -> &T

impl BorrowMut for JsonNumber

borrow_mut

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

impl CloneToUninit for JsonNumber

clone_to_uninit

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

impl Into for JsonNumber

into

fn into(self: Self) -> U

Calls U::from(self).

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

impl From for JsonNumber

from

fn from(t: T) -> T

Returns the argument unchanged.

impl TryInto for JsonNumber

Error

try_into

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

impl TryFrom for JsonNumber

Error

try_from

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

impl Any for JsonNumber

type_id

fn type_id(self: &Self) -> TypeId

impl ToOwned for JsonNumber

Owned

to_owned

fn to_owned(self: &Self) -> T

clone_into

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

impl ToString for JsonNumber

to_string

fn to_string(self: &Self) -> String

impl Same for JsonNumber

Output

impl RunxSchema for JsonNumber

json_schema

fn json_schema() -> Value

impl Clone for JsonNumber

clone

fn clone(self: &Self) -> JsonNumber

impl Debug for JsonNumber

impl PartialEq for JsonNumber

eq

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

impl Serialize for JsonNumber

serialize

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

impl Deserialize for JsonNumber

deserialize

fn deserialize(deserializer: D) -> Result<Self, <D as >::Error>

impl Display for JsonNumber

fmt

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

impl Send for JsonNumber

impl Sync for JsonNumber

impl Freeze for JsonNumber

impl UnsafeUnpin for JsonNumber

impl Unpin for JsonNumber

impl UnwindSafe for JsonNumber

impl RefUnwindSafe for JsonNumber

impl DeserializeOwned for JsonNumber

impl StructuralPartialEq for JsonNumber

Type Aliases §

JsonObject §

pub type runx_contracts::json::JsonObject = std::collections::BTreeMap;

Functions §

json_object §

fn json_object(value: Option<&JsonValue>) -> Option<&JsonObject>
#[must_use]

json_object_field §

fn json_object_field(object: &'a JsonObject, field: &str) -> Option<&'a JsonObject>
#[must_use]

json_string_field §

fn json_string_field(object: &'a JsonObject, field: &str) -> Option<&'a str>
#[must_use]

json_bool_field §

fn json_bool_field(object: &JsonObject, field: &str) -> Option<bool>
#[must_use]