DynamicValueVTable

Struct DynamicValueVTable 

Source
#[repr(C)]
pub struct DynamicValueVTable {
Show 28 fields pub set_null: DynSetNullFn, pub set_bool: DynSetBoolFn, pub set_i64: DynSetI64Fn, pub set_u64: DynSetU64Fn, pub set_f64: DynSetF64Fn, pub set_str: DynSetStrFn, pub set_bytes: Option<DynSetBytesFn>, pub set_datetime: Option<DynSetDateTimeFn>, pub begin_array: DynBeginArrayFn, pub push_array_element: DynPushArrayElementFn, pub end_array: Option<DynEndArrayFn>, pub begin_object: DynBeginObjectFn, pub insert_object_entry: DynInsertObjectEntryFn, pub end_object: Option<DynEndObjectFn>, pub get_kind: DynGetKindFn, pub get_bool: DynGetBoolFn, pub get_i64: DynGetI64Fn, pub get_u64: DynGetU64Fn, pub get_f64: DynGetF64Fn, pub get_str: DynGetStrFn, pub get_bytes: Option<DynGetBytesFn>, pub get_datetime: Option<DynGetDateTimeFn>, pub array_len: DynArrayLenFn, pub array_get: DynArrayGetFn, pub object_len: DynObjectLenFn, pub object_get_entry: DynObjectGetEntryFn, pub object_get: DynObjectGetFn, pub object_get_mut: Option<DynObjectGetMutFn>,
}
Expand description

Virtual table for dynamic value types.

This provides all the operations needed to build and read dynamic values without knowing their concrete type at compile time.

Fields§

§set_null: DynSetNullFn

Set to null

§set_bool: DynSetBoolFn

Set to boolean

§set_i64: DynSetI64Fn

Set to i64

§set_u64: DynSetU64Fn

Set to u64

§set_f64: DynSetF64Fn

Set to f64 (returns false if value not representable)

§set_str: DynSetStrFn

Set to string

§set_bytes: Option<DynSetBytesFn>

Set to bytes (optional - not all dynamic value types support bytes)

§set_datetime: Option<DynSetDateTimeFn>

Set to datetime (optional - not all dynamic value types support datetime)

§begin_array: DynBeginArrayFn

Initialize as empty array

§push_array_element: DynPushArrayElementFn

Push element to array

§end_array: Option<DynEndArrayFn>

Finalize array (optional)

§begin_object: DynBeginObjectFn

Initialize as empty object

§insert_object_entry: DynInsertObjectEntryFn

Insert key-value pair

§end_object: Option<DynEndObjectFn>

Finalize object (optional)

§get_kind: DynGetKindFn

Get the kind of value

§get_bool: DynGetBoolFn

Get bool value

§get_i64: DynGetI64Fn

Get i64 value

§get_u64: DynGetU64Fn

Get u64 value

§get_f64: DynGetF64Fn

Get f64 value

§get_str: DynGetStrFn

Get string reference

§get_bytes: Option<DynGetBytesFn>

Get bytes reference

§get_datetime: Option<DynGetDateTimeFn>

Get datetime components

§array_len: DynArrayLenFn

Get array length

§array_get: DynArrayGetFn

Get array element by index

§object_len: DynObjectLenFn

Get object length

§object_get_entry: DynObjectGetEntryFn

Get object entry by index

§object_get: DynObjectGetFn

Get object value by key

§object_get_mut: Option<DynObjectGetMutFn>

Get mutable reference to object value by key (for navigating into existing entries)

Trait Implementations§

Source§

impl Clone for DynamicValueVTable

Source§

fn clone(&self) -> DynamicValueVTable

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 DynamicValueVTable

Source§

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

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

impl Copy for DynamicValueVTable

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