Skip to main content

Value

Enum Value 

Source
pub enum Value {
Show 25 variants Void, Bool(bool), Octet(u8), Short(i16), UShort(u16), Long(i32), ULong(u32), LongLong(i64), ULongLong(u64), Float(f32), Double(f64), LongDouble(LongDouble), Char(char), WChar(u16), String(String), Octets(Octets), Chars(String), List(Vec<Value>), Union { disc: Box<Value>, member: Option<(u32, Box<Value>)>, }, Enum(u32), Fixed { digits: Vec<u8>, negative: bool, }, Objref(Option<ObjectRef>), TypeCode(TypeCode), Any(Box<Any>), Valuetype(Option<ValueRef>),
}
Expand description

A value of an IDL type. Which variant goes with which type:

TypeValue
void, nullVoid
integers, float, double, boolean, octetthe variant of the same name
char, wcharChar (a character of the char code set), WChar (a UTF-16 code unit)
string, wstringString
sequence and array of octet, PrincipalOctets (or List of Octet)
sequence and array of charChars (or List of Char)
other sequences and arrays, struct, exceptionList: the elements or the members in order (an exception is written with its repository id first, as in a reply)
unionUnion: the discriminator, and the index of the TypeCode member with its value, None when no member is selected
enumEnum: the position of the enumerator
long doubleLongDouble: the binary128 bits (LongDouble)
fixedFixed: the digits (as many as the type has, most significant first) and the sign
object referenceObjref, None for nil
TypeCodeTypeCode
anyAny
valuetype, value boxValuetype: a shared ValueRef, None for null
abstract interfaceObjref (sent as a reference) or Valuetype (sent as a value)

Aliases take the value of the type they stand for. The state of a custom valuetype is the items its marshaling code writes, each a Value::Any of the item’s type and value (see register_custom_reader).

Variants§

§

Void

§

Bool(bool)

§

Octet(u8)

§

Short(i16)

§

UShort(u16)

§

Long(i32)

§

ULong(u32)

§

LongLong(i64)

§

ULongLong(u64)

§

Float(f32)

§

Double(f64)

§

LongDouble(LongDouble)

§

Char(char)

§

WChar(u16)

§

String(String)

§

Octets(Octets)

§

Chars(String)

§

List(Vec<Value>)

§

Union

Fields

§disc: Box<Value>
§member: Option<(u32, Box<Value>)>
§

Enum(u32)

§

Fixed

Fields

§digits: Vec<u8>
§negative: bool
§

Objref(Option<ObjectRef>)

§

TypeCode(TypeCode)

§

Any(Box<Any>)

§

Valuetype(Option<ValueRef>)

Implementations§

Source§

impl Value

Source

pub fn label_key(&self) -> Option<i128>

The number a union discriminator value stands for, as in union labels (TypeCode::union_tc): integers as they are, boolean as 0 or 1, char and wchar as their code, an enumerator as its position. None for values that cannot be discriminators.

Source§

impl Value

Source

pub fn break_cycles(self)

Breaks the reference cycles that valuetypes in this value may form, so that they are freed: the state of every ValueRef in it is emptied. For a binding that is done with a value it made.

Source

pub fn release(self)

Drops the value, and first breaks the reference cycles among the valuetypes in it that nothing else refers to, so that they are freed: for a binding that drops a value it may share. Instances that are referred to from elsewhere (another value, a binding’s object), and those they refer to, are left as they are.

The instances reachable from the value are counted: one whose references are not all from the value and the instances reachable from it is referred to from elsewhere (trial deletion).

Trait Implementations§

Source§

impl Clone for Value

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Value

Source§

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

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

impl PartialEq for Value

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for Value

§

impl !UnwindSafe for Value

§

impl Freeze for Value

§

impl Send for Value

§

impl Sync for Value

§

impl Unpin for Value

§

impl UnsafeUnpin for Value

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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.