Skip to main content

DynAny

Struct DynAny 

Source
pub struct DynAny(/* private fields */);
Expand description

DynamicAny::DynAny and the interfaces derived from it. Clones are the same object, as references are.

Implementations§

Source§

impl DynAny

Source

pub fn kind(&self) -> TCKind

The unaliased kind of the type, which tells which interface of DynamicAny the DynAny is: DynStruct for structs and exceptions, DynFixed, DynEnum, DynUnion, DynSequence, DynArray, DynValue (valuetypes and eventtypes), DynValueBox, plain DynAny for the others.

Source

pub fn ptr_eq(&self, other: &DynAny) -> bool

Whether both are the same DynAny.

Source

pub fn type_code(&self) -> Result<TypeCode, DynAnyError>

type: the TypeCode of the DynAny, aliases included.

Source

pub fn assign(&self, other: &DynAny) -> Result<(), DynAnyError>

assign: gives this DynAny the value of other. TypeMismatch if the types are not equivalent.

Source

pub fn from_any(&self, value: &Any) -> Result<(), DynAnyError>

from_any: gives this DynAny the value of value. TypeMismatch if the types are not equivalent; InvalidValue if the value does not fit the type.

Source

pub fn to_any(&self) -> Result<Any, DynAnyError>

to_any: the value as an Any of the type of the DynAny.

Source

pub fn equal(&self, other: &DynAny) -> Result<bool, DynAnyError>

equal: whether both have equivalent types and equal values.

Source

pub fn destroy(&self) -> Result<(), DynAnyError>

destroy: destroys a DynAny made by the factory or by copy and its components; using them afterwards is OBJECT_NOT_EXIST. Destroying a component does nothing.

Source

pub fn copy(&self) -> Result<DynAny, DynAnyError>

copy: a new DynAny with the type and the value of this one.

Source

pub fn insert_basic( &self, kind: TCKind, value: Value, ) -> Result<(), DynAnyError>

insert_<type> with the value of the type kind (Objref for insert_reference, Value for insert_val): sets the value of the target if its unaliased type is of that kind, else TypeMismatch. A string longer than a bounded string type is InvalidValue.

Source

pub fn get_basic(&self, kind: TCKind) -> Result<Value, DynAnyError>

get_<type>: the value of the target if its unaliased type is of the kind kind, else TypeMismatch.

Source

pub fn insert_boolean(&self, v: bool) -> Result<(), DynAnyError>

insert_boolean: see DynAny::insert_basic.

Source

pub fn get_boolean(&self) -> Result<bool, DynAnyError>

get_boolean: see DynAny::get_basic.

Source

pub fn insert_octet(&self, v: u8) -> Result<(), DynAnyError>

insert_octet: see DynAny::insert_basic.

Source

pub fn get_octet(&self) -> Result<u8, DynAnyError>

get_octet: see DynAny::get_basic.

Source

pub fn insert_char(&self, v: char) -> Result<(), DynAnyError>

insert_char: see DynAny::insert_basic.

Source

pub fn get_char(&self) -> Result<char, DynAnyError>

get_char: see DynAny::get_basic.

Source

pub fn insert_short(&self, v: i16) -> Result<(), DynAnyError>

insert_short: see DynAny::insert_basic.

Source

pub fn get_short(&self) -> Result<i16, DynAnyError>

get_short: see DynAny::get_basic.

Source

pub fn insert_ushort(&self, v: u16) -> Result<(), DynAnyError>

insert_ushort: see DynAny::insert_basic.

Source

pub fn get_ushort(&self) -> Result<u16, DynAnyError>

get_ushort: see DynAny::get_basic.

Source

pub fn insert_long(&self, v: i32) -> Result<(), DynAnyError>

insert_long: see DynAny::insert_basic.

Source

pub fn get_long(&self) -> Result<i32, DynAnyError>

get_long: see DynAny::get_basic.

Source

pub fn insert_ulong(&self, v: u32) -> Result<(), DynAnyError>

insert_ulong: see DynAny::insert_basic.

Source

pub fn get_ulong(&self) -> Result<u32, DynAnyError>

get_ulong: see DynAny::get_basic.

Source

pub fn insert_float(&self, v: f32) -> Result<(), DynAnyError>

insert_float: see DynAny::insert_basic.

Source

pub fn get_float(&self) -> Result<f32, DynAnyError>

get_float: see DynAny::get_basic.

Source

pub fn insert_double(&self, v: f64) -> Result<(), DynAnyError>

insert_double: see DynAny::insert_basic.

Source

pub fn get_double(&self) -> Result<f64, DynAnyError>

get_double: see DynAny::get_basic.

Source

pub fn insert_longdouble(&self, v: LongDouble) -> Result<(), DynAnyError>

insert_longdouble: see DynAny::insert_basic.

Source

pub fn get_longdouble(&self) -> Result<LongDouble, DynAnyError>

get_longdouble: see DynAny::get_basic.

Source

pub fn insert_longlong(&self, v: i64) -> Result<(), DynAnyError>

insert_longlong: see DynAny::insert_basic.

Source

pub fn get_longlong(&self) -> Result<i64, DynAnyError>

get_longlong: see DynAny::get_basic.

Source

pub fn insert_ulonglong(&self, v: u64) -> Result<(), DynAnyError>

insert_ulonglong: see DynAny::insert_basic.

Source

pub fn get_ulonglong(&self) -> Result<u64, DynAnyError>

get_ulonglong: see DynAny::get_basic.

Source

pub fn insert_wchar(&self, v: u16) -> Result<(), DynAnyError>

insert_wchar: see DynAny::insert_basic.

Source

pub fn get_wchar(&self) -> Result<u16, DynAnyError>

get_wchar: see DynAny::get_basic.

Source

pub fn insert_typecode(&self, v: TypeCode) -> Result<(), DynAnyError>

insert_typecode: see DynAny::insert_basic.

Source

pub fn get_typecode(&self) -> Result<TypeCode, DynAnyError>

get_typecode: see DynAny::get_basic.

Source

pub fn insert_reference(&self, v: Option<ObjectRef>) -> Result<(), DynAnyError>

insert_reference: see DynAny::insert_basic.

Source

pub fn get_reference(&self) -> Result<Option<ObjectRef>, DynAnyError>

get_reference: see DynAny::get_basic.

Source

pub fn insert_val(&self, v: Option<ValueRef>) -> Result<(), DynAnyError>

insert_val: see DynAny::insert_basic.

Source

pub fn get_val(&self) -> Result<Option<ValueRef>, DynAnyError>

get_val: see DynAny::get_basic.

Source

pub fn insert_string(&self, v: &str) -> Result<(), DynAnyError>

insert_string.

Source

pub fn get_string(&self) -> Result<String, DynAnyError>

get_string.

Source

pub fn insert_wstring(&self, v: &str) -> Result<(), DynAnyError>

insert_wstring.

Source

pub fn get_wstring(&self) -> Result<String, DynAnyError>

get_wstring.

Source

pub fn insert_any(&self, v: &Any) -> Result<(), DynAnyError>

insert_any.

Source

pub fn get_any(&self) -> Result<Any, DynAnyError>

get_any.

Source

pub fn insert_dyn_any(&self, v: &DynAny) -> Result<(), DynAnyError>

insert_dyn_any: insert_any with the value of v.

Source

pub fn get_dyn_any(&self) -> Result<DynAny, DynAnyError>

get_dyn_any: a new DynAny of the value in the any.

Source

pub fn no_implement(&self) -> Result<(), DynAnyError>

insert_abstract / get_abstract: NO_IMPLEMENT.

Source

pub fn insert_seq( &self, kind: TCKind, values: Vec<Value>, ) -> Result<(), DynAnyError>

insert_<type>_seq: sets the elements of the target (this DynAny if it is a sequence or array of that kind or has no components, else its current component), a sequence or array of elements of the kind kind, else TypeMismatch. Too many elements for a bounded sequence, or not as many as an array has, is InvalidValue. The position becomes the first element.

Source

pub fn get_seq(&self, kind: TCKind) -> Result<Vec<Value>, DynAnyError>

get_<type>_seq: the elements of the target (this DynAny if it is a sequence or array of that kind or has no components, else its current component), a sequence or array of elements of the kind kind, else TypeMismatch.

Source

pub fn insert_boolean_seq(&self, v: &[bool]) -> Result<(), DynAnyError>

insert_boolean_seq: see DynAny::insert_seq.

Source

pub fn get_boolean_seq(&self) -> Result<Vec<bool>, DynAnyError>

get_boolean_seq: see DynAny::get_seq.

Source

pub fn insert_octet_seq(&self, v: &[u8]) -> Result<(), DynAnyError>

insert_octet_seq: see DynAny::insert_seq.

Source

pub fn get_octet_seq(&self) -> Result<Vec<u8>, DynAnyError>

get_octet_seq: see DynAny::get_seq.

Source

pub fn insert_char_seq(&self, v: &[char]) -> Result<(), DynAnyError>

insert_char_seq: see DynAny::insert_seq.

Source

pub fn get_char_seq(&self) -> Result<Vec<char>, DynAnyError>

get_char_seq: see DynAny::get_seq.

Source

pub fn insert_short_seq(&self, v: &[i16]) -> Result<(), DynAnyError>

insert_short_seq: see DynAny::insert_seq.

Source

pub fn get_short_seq(&self) -> Result<Vec<i16>, DynAnyError>

get_short_seq: see DynAny::get_seq.

Source

pub fn insert_ushort_seq(&self, v: &[u16]) -> Result<(), DynAnyError>

insert_ushort_seq: see DynAny::insert_seq.

Source

pub fn get_ushort_seq(&self) -> Result<Vec<u16>, DynAnyError>

get_ushort_seq: see DynAny::get_seq.

Source

pub fn insert_long_seq(&self, v: &[i32]) -> Result<(), DynAnyError>

insert_long_seq: see DynAny::insert_seq.

Source

pub fn get_long_seq(&self) -> Result<Vec<i32>, DynAnyError>

get_long_seq: see DynAny::get_seq.

Source

pub fn insert_ulong_seq(&self, v: &[u32]) -> Result<(), DynAnyError>

insert_ulong_seq: see DynAny::insert_seq.

Source

pub fn get_ulong_seq(&self) -> Result<Vec<u32>, DynAnyError>

get_ulong_seq: see DynAny::get_seq.

Source

pub fn insert_float_seq(&self, v: &[f32]) -> Result<(), DynAnyError>

insert_float_seq: see DynAny::insert_seq.

Source

pub fn get_float_seq(&self) -> Result<Vec<f32>, DynAnyError>

get_float_seq: see DynAny::get_seq.

Source

pub fn insert_double_seq(&self, v: &[f64]) -> Result<(), DynAnyError>

insert_double_seq: see DynAny::insert_seq.

Source

pub fn get_double_seq(&self) -> Result<Vec<f64>, DynAnyError>

get_double_seq: see DynAny::get_seq.

Source

pub fn insert_longdouble_seq(&self, v: &[LongDouble]) -> Result<(), DynAnyError>

insert_longdouble_seq: see DynAny::insert_seq.

Source

pub fn get_longdouble_seq(&self) -> Result<Vec<LongDouble>, DynAnyError>

get_longdouble_seq: see DynAny::get_seq.

Source

pub fn insert_longlong_seq(&self, v: &[i64]) -> Result<(), DynAnyError>

insert_longlong_seq: see DynAny::insert_seq.

Source

pub fn get_longlong_seq(&self) -> Result<Vec<i64>, DynAnyError>

get_longlong_seq: see DynAny::get_seq.

Source

pub fn insert_ulonglong_seq(&self, v: &[u64]) -> Result<(), DynAnyError>

insert_ulonglong_seq: see DynAny::insert_seq.

Source

pub fn get_ulonglong_seq(&self) -> Result<Vec<u64>, DynAnyError>

get_ulonglong_seq: see DynAny::get_seq.

Source

pub fn insert_wchar_seq(&self, v: &[u16]) -> Result<(), DynAnyError>

insert_wchar_seq: see DynAny::insert_seq.

Source

pub fn get_wchar_seq(&self) -> Result<Vec<u16>, DynAnyError>

get_wchar_seq: see DynAny::get_seq.

Source

pub fn component_count(&self) -> Result<u32, DynAnyError>

component_count: the members of a struct, exception or valuetype (0 for null), the elements of a sequence or array, 2 for a union with an active member and 1 without, 1 for a value box that is not null, 0 for the other types.

Source

pub fn seek(&self, index: i32) -> Result<bool, DynAnyError>

seek: makes index the current position. True if there is a component there; else the position becomes -1 and the result is false.

Source

pub fn rewind(&self) -> Result<(), DynAnyError>

rewind: seek(0).

Source

pub fn next(&self) -> Result<bool, DynAnyError>

next: moves to the next component (from -1 to the first). True if there is one; else the position becomes -1 and the result is false.

Source

pub fn position(&self) -> Result<i32, DynAnyError>

The current position, -1 when there is no current component.

Source

pub fn current_component(&self) -> Result<Option<DynAny>, DynAnyError>

current_component: the component at the current position, None at -1. TypeMismatch for a DynAny that cannot have components (DynEnum, DynFixed, basic types), for an exception without members and for a null valuetype or value box.

Source

pub fn get_fixed_value(&self) -> Result<String, DynAnyError>

DynFixed::get_value: the value as a fixed-point literal without the d suffix and without zeros at the end of the fraction, such as -123.45, -12.5 or 0.

Source

pub fn set_fixed_value(&self, literal: &str) -> Result<bool, DynAnyError>

DynFixed::set_value: sets the value from a fixed-point literal (an optional sign, digits with an optional point, an optional d or D, blanks around). TypeMismatch if it is not one, InvalidValue if its integer part has too many digits. Digits after the scale are cut off, and the result is then false.

Source

pub fn get_enum_as_ulong(&self) -> Result<u32, DynAnyError>

DynEnum::get_as_ulong: the position of the enumerator.

Source

pub fn set_enum_as_ulong(&self, v: u32) -> Result<(), DynAnyError>

DynEnum::set_as_ulong: InvalidValue if there is no enumerator at v.

Source

pub fn get_enum_as_string(&self) -> Result<String, DynAnyError>

DynEnum::get_as_string: the name of the enumerator.

Source

pub fn set_enum_as_string(&self, name: &str) -> Result<(), DynAnyError>

DynEnum::set_as_string: InvalidValue if no enumerator has the name.

Source

pub fn current_member_name(&self) -> Result<String, DynAnyError>

current_member_name of DynStruct and DynValue. TypeMismatch without members (or null), InvalidValue at position -1.

Source

pub fn current_member_kind(&self) -> Result<TCKind, DynAnyError>

current_member_kind of DynStruct and DynValue: the kind of the member’s type, aliases included.

Source

pub fn get_members(&self) -> Result<Vec<(String, Any)>, DynAnyError>

get_members of DynStruct and DynValue: the names and values of the members. InvalidValue for a null valuetype.

Source

pub fn get_members_as_dyn_any( &self, ) -> Result<Vec<(String, DynAny)>, DynAnyError>

get_members_as_dyn_any: the names and the components.

Source

pub fn set_members(&self, values: &[(String, Any)]) -> Result<(), DynAnyError>

set_members of DynStruct and DynValue: as many values as there are members (else InvalidValue), each with the name of its member or an empty one and a type equivalent to the member’s (else TypeMismatch). A null valuetype is no longer null.

Source

pub fn set_members_as_dyn_any( &self, values: &[(String, DynAny)], ) -> Result<(), DynAnyError>

set_members_as_dyn_any: set_members with the values of the DynAnys.

Source

pub fn get_discriminator(&self) -> Result<DynAny, DynAnyError>

DynUnion::get_discriminator: the discriminator component.

Source

pub fn set_discriminator(&self, d: &DynAny) -> Result<(), DynAnyError>

DynUnion::set_discriminator: sets the discriminator to the value of d (TypeMismatch if its type is not equivalent to the discriminator type). The member it selects keeps its value if it was already active and gets its default value otherwise; the position becomes 1 if there is an active member, else 0.

Source

pub fn set_to_default_member(&self) -> Result<(), DynAnyError>

DynUnion::set_to_default_member: sets the discriminator to a value no label uses, which selects the default member. TypeMismatch if the union has no default member.

Source

pub fn set_to_no_active_member(&self) -> Result<(), DynAnyError>

DynUnion::set_to_no_active_member: sets the discriminator to a value no label uses. TypeMismatch if the union has a default member or its labels use every value of the discriminator type.

Source

pub fn has_no_active_member(&self) -> Result<bool, DynAnyError>

DynUnion::has_no_active_member.

Source

pub fn discriminator_kind(&self) -> Result<TCKind, DynAnyError>

DynUnion::discriminator_kind: the kind of the discriminator type, aliases included.

Source

pub fn member(&self) -> Result<DynAny, DynAnyError>

DynUnion::member: the active member. InvalidValue without one.

Source

pub fn member_name(&self) -> Result<String, DynAnyError>

DynUnion::member_name: the name of the active member. InvalidValue without one.

Source

pub fn member_kind(&self) -> Result<TCKind, DynAnyError>

DynUnion::member_kind: the kind of the type of the active member, aliases included. InvalidValue without one.

Source

pub fn get_length(&self) -> Result<u32, DynAnyError>

DynSequence::get_length.

Source

pub fn set_length(&self, len: u32) -> Result<(), DynAnyError>

DynSequence::set_length: new elements get their default value. When the sequence grows and there was no current position, the first new element becomes current; when it shrinks past the current position, the position becomes -1. Longer than the bound is InvalidValue.

Source

pub fn get_elements(&self) -> Result<Vec<Any>, DynAnyError>

get_elements of DynSequence and DynArray.

Source

pub fn get_elements_as_dyn_any(&self) -> Result<Vec<DynAny>, DynAnyError>

get_elements_as_dyn_any: the components.

Source

pub fn set_elements(&self, values: &[Any]) -> Result<(), DynAnyError>

set_elements of DynSequence and DynArray: TypeMismatch if a value’s type is not equivalent to the element type, InvalidValue if there are more than the bound of a sequence or not as many as an array has.

Source

pub fn set_elements_as_dyn_any( &self, values: &[DynAny], ) -> Result<(), DynAnyError>

set_elements_as_dyn_any: set_elements with the values of the DynAnys.

Source

pub fn is_null(&self) -> Result<bool, DynAnyError>

DynValueCommon::is_null.

Source

pub fn set_to_null(&self) -> Result<(), DynAnyError>

DynValueCommon::set_to_null.

Source

pub fn set_to_value(&self) -> Result<(), DynAnyError>

DynValueCommon::set_to_value: a null value gets members with their default values; a value that is not null is left as it is.

Source

pub fn get_boxed_value(&self) -> Result<Any, DynAnyError>

DynValueBox::get_boxed_value. InvalidValue if null.

Source

pub fn get_boxed_value_as_dyn_any(&self) -> Result<DynAny, DynAnyError>

DynValueBox::get_boxed_value_as_dyn_any: the component. InvalidValue if null.

Source

pub fn set_boxed_value(&self, value: &Any) -> Result<(), DynAnyError>

DynValueBox::set_boxed_value: TypeMismatch if the type of value is not equivalent to the boxed type. A null value box is no longer null.

Source

pub fn set_boxed_value_as_dyn_any( &self, value: &DynAny, ) -> Result<(), DynAnyError>

DynValueBox::set_boxed_value_as_dyn_any.

Trait Implementations§

Source§

impl Clone for DynAny

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 DynAny

Source§

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

Formats the value using the given formatter. Read more

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

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.