Enum RValue

Source
pub enum RValue {
Show 17 variants Unit, Prim(PValue), Bytes { typename: String, value: Vec<u8>, }, Ref { typename: RefType, addr: RefAddr, value: Box<RValue>, }, DynRef { typename: String, addr: RefAddr, vtable: RefAddr, value: Box<RValue>, }, RefCounted { typename: RefCountedType, addr: RefAddr, strong: u64, weak: u64, value: Box<RValue>, }, DynRefCounted { typename: String, addr: RefAddr, strong: u64, weak: u64, vtable: RefAddr, value: Box<RValue>, }, UnresolvedRef { addr: RefAddr, }, Struct { typename: String, fields: IndexMap<String, RValue>, }, Tuple { typename: String, items: Vec<RValue>, }, Enum { typename: String, variant: String, }, String { typename: StringType, value: String, }, Union { typeinfo: UnionType, variant: String, fields: IndexMap<String, RValue>, }, Option { typename: String, variant: String, value: Option<Box<RValue>>, }, Result { typename: String, variant: String, value: Box<RValue>, }, Array { typename: ArrayType, data: Vec<RValue>, }, Opaque,
}
Expand description

A representation of Rust Value

Variants§

§

Unit

Aka ()

§

Prim(PValue)

§

Bytes

Fields

§typename: String
§value: Vec<u8>
§

Ref

This includes a simple &v, as well as Box and *const

Fields

§typename: RefType
§addr: RefAddr
§value: Box<RValue>
§

DynRef

&dyn or Box

Fields

§typename: String
§addr: RefAddr
§vtable: RefAddr
§value: Box<RValue>
§

RefCounted

Rc or Arc

Fields

§addr: RefAddr
§strong: u64
§weak: u64
§value: Box<RValue>
§

DynRefCounted

Rc or Arc

Fields

§typename: String
§addr: RefAddr
§strong: u64
§weak: u64
§vtable: RefAddr
§value: Box<RValue>
§

UnresolvedRef

Fields

§addr: RefAddr
§

Struct

Fields

§typename: String
§

Tuple

Fields

§typename: String
§items: Vec<RValue>
§

Enum

Fields

§typename: String
§variant: String
§

String

Fields

§typename: StringType
§value: String
§

Union

Fields

§typeinfo: UnionType
§variant: String
§

Option

Fields

§typename: String
§variant: String
§

Result

Fields

§typename: String
§variant: String
§value: Box<RValue>
§

Array

Fields

§typename: ArrayType
§data: Vec<RValue>
§

Opaque

Implementations§

Source§

impl RValue

Source

pub fn redact_addr(&mut self)

Source

pub fn prim(&self) -> Option<PValue>

Source

pub fn struct_field(&self, field: &str) -> Option<&RValue>

Source§

impl RValue

Source

pub fn typename(&self) -> String

Source

pub fn is_struct(&self) -> bool

Source

pub fn is_result(&self) -> bool

Source

pub fn result_variant(&self) -> Result<(), ()>

§Panics

Panic if self is not of Result variant, or variant is not “Ok” or “Err”.

Trait Implementations§

Source§

impl Clone for RValue

Source§

fn clone(&self) -> RValue

Returns a copy 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 RValue

Source§

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

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

impl<'de> Deserialize<'de> for RValue

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<RValue, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

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

impl Display for RValue

Source§

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

Pretty print RValue in a Rust-like syntax. Using {:#} would expand to multiple lines.

Similar to std::fmt::Debug, but the goal is to make the format string almost-compile.

Source§

impl PartialEq for RValue

Source§

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

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

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

impl StructuralPartialEq for RValue

Auto Trait Implementations§

§

impl Freeze for RValue

§

impl RefUnwindSafe for RValue

§

impl Send for RValue

§

impl Sync for RValue

§

impl Unpin for RValue

§

impl UnwindSafe for RValue

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

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T