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:
| Type | Value |
|---|---|
void, null | Void |
integers, float, double, boolean, octet | the variant of the same name |
char, wchar | Char (a character of the char code set), WChar (a UTF-16 code unit) |
string, wstring | String |
sequence and array of octet, Principal | Octets (or List of Octet) |
sequence and array of char | Chars (or List of Char) |
other sequences and arrays, struct, exception | List: the elements or the members in order (an exception is written with its repository id first, as in a reply) |
| union | Union: the discriminator, and the index of the TypeCode member with its value, None when no member is selected |
| enum | Enum: the position of the enumerator |
long double | LongDouble: the binary128 bits (LongDouble) |
fixed | Fixed: the digits (as many as the type has, most significant first) and the sign |
| object reference | Objref, None for nil |
TypeCode | TypeCode |
any | Any |
| valuetype, value box | Valuetype: a shared ValueRef, None for null |
| abstract interface | Objref (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
Enum(u32)
Fixed
Objref(Option<ObjectRef>)
TypeCode(TypeCode)
Any(Box<Any>)
Valuetype(Option<ValueRef>)
Implementations§
Source§impl Value
impl Value
Sourcepub fn label_key(&self) -> Option<i128>
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
impl Value
Sourcepub fn break_cycles(self)
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.
Sourcepub fn release(self)
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).