Container

Enum Container 

Source
pub enum Container<'e, 'a: 'e> {
    Array(Array<'e, 'a>),
    Struct(Vec<Param<'a, 'e>>),
    Dict(Dict<'a, 'e>),
    Variant(Box<Variant<'a, 'e>>),
    ArrayRef(ArrayRef<'a, 'e>),
    StructRef(&'a [Param<'a, 'e>]),
    DictRef(DictRef<'a, 'e>),
}
Expand description

The container types a message can have as parameters

’a is the lifetime of the Container, ’e the liftime of the params which may be longer

Variants§

§

Array(Array<'e, 'a>)

§

Struct(Vec<Param<'a, 'e>>)

§

Dict(Dict<'a, 'e>)

§

Variant(Box<Variant<'a, 'e>>)

§

ArrayRef(ArrayRef<'a, 'e>)

§

StructRef(&'a [Param<'a, 'e>])

§

DictRef(DictRef<'a, 'e>)

Implementations§

Source§

impl<'e, 'a: 'e> Container<'a, 'e>

Source

pub fn push<P: Into<Param<'a, 'e>>>( &mut self, new: P, ) -> Result<(), MarshalError>

Source

pub fn insert<K: Into<Base<'a>>, V: Into<Param<'a, 'e>>>( &mut self, key: K, val: V, ) -> Result<(), MarshalError>

Source§

impl<'e, 'a: 'e> Container<'a, 'e>

Source

pub fn make_struct<P: Into<Param<'a, 'e>>>( elements: Vec<P>, ) -> Container<'a, 'e>

Source

pub fn make_struct_ref(elements: &'a [Param<'a, 'e>]) -> Container<'a, 'e>

Source

pub fn make_struct1<P: Into<Param<'a, 'e>>>(e1: P) -> Container<'a, 'e>

Source

pub fn make_struct2<P1: Into<Param<'a, 'e>>, P2: Into<Param<'a, 'e>>>( e1: P1, e2: P2, ) -> Container<'a, 'e>

Source

pub fn make_struct3<P1: Into<Param<'a, 'e>>, P2: Into<Param<'a, 'e>>, P3: Into<Param<'a, 'e>>>( e1: P1, e2: P2, e3: P3, ) -> Container<'a, 'e>

Source

pub fn make_variant<P: Into<Param<'a, 'e>>>(element: P) -> Container<'a, 'e>

Source

pub fn make_array_ref( element_sig: &str, elements: &'a [Param<'a, 'e>], ) -> Result<Container<'a, 'e>, MarshalError>

Source

pub fn make_array_ref_with_sig( element_sig: Type, elements: &'a [Param<'a, 'e>], ) -> Result<Container<'a, 'e>, MarshalError>

Source

pub fn make_array<P: Into<Param<'a, 'e>>, I: Iterator<Item = P>>( element_sig: &str, elements: I, ) -> Result<Container<'a, 'e>, MarshalError>

Source

pub fn make_array_with_sig<P: Into<Param<'a, 'e>>, I: Iterator<Item = P>>( element_sig: Type, elements: I, ) -> Result<Container<'a, 'e>, MarshalError>

Source

pub fn make_dict<K: Into<Base<'e>>, V: Into<Param<'a, 'e>>, I: Iterator<Item = (K, V)>>( key_sig: &str, val_sig: &str, map: I, ) -> Result<Container<'a, 'e>, MarshalError>

Source

pub fn make_dict_with_sig<K: Into<Base<'e>>, V: Into<Param<'a, 'e>>, I: Iterator<Item = (K, V)>>( key_sig: Base, value_sig: Type, map: I, ) -> Result<Container<'a, 'e>, MarshalError>

Source

pub fn make_dict_ref( key_sig: &str, val_sig: &str, map: &'a DictMap<'_, '_>, ) -> Result<Container<'a, 'e>, MarshalError>

Source

pub fn make_dict_ref_with_sig( key_sig: Base, value_sig: Type, map: &'a DictMap<'_, '_>, ) -> Result<Container<'a, 'e>, MarshalError>

Source§

impl<'a, 'e> Container<'a, 'e>

Source

pub fn make_signature(&self, buf: &mut String)

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn sig(&self) -> Type

Trait Implementations§

Source§

impl<'e, 'a: 'e> Clone for Container<'e, 'a>

Source§

fn clone(&self) -> Container<'e, 'a>

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<'e, 'a: 'e> Debug for Container<'e, 'a>

Source§

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

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

impl<'a, 'e> From<&Container<'a, 'e>> for Container

Source§

fn from(c: &Container<'a, 'e>) -> Container

Converts to this type from the input type.
Source§

impl<'a, 'e> From<Container<'a, 'e>> for Param<'a, 'e>

Source§

fn from(s: Container<'a, 'e>) -> Self

Converts to this type from the input type.
Source§

impl<'e, 'a: 'e> PartialEq for Container<'e, 'a>

Source§

fn eq(&self, other: &Container<'e, 'a>) -> 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<'a, 'e> TryFrom<(Base, Type, HashMap<Base<'a>, Param<'a, 'e>>)> for Container<'a, 'e>

Source§

type Error = ConversionError

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

fn try_from( parts: (Base, Type, DictMap<'a, 'e>), ) -> Result<Container<'a, 'e>, ConversionError>

Performs the conversion.
Source§

impl<'a, 'e> TryFrom<(Type, Vec<Param<'a, 'e>>)> for Container<'a, 'e>

Source§

type Error = ConversionError

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

fn try_from( parts: (Type, Vec<Param<'a, 'e>>), ) -> Result<Container<'a, 'e>, ConversionError>

Performs the conversion.
Source§

impl<'a, 'e> TryFrom<HashMap<Base<'a>, Param<'a, 'e>>> for Container<'a, 'e>

Source§

type Error = ConversionError

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

fn try_from( elems: DictMap<'a, 'e>, ) -> Result<Container<'a, 'e>, ConversionError>

Performs the conversion.
Source§

impl<'a, 'e> TryFrom<Vec<Param<'a, 'e>>> for Container<'a, 'e>

Source§

type Error = ConversionError

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

fn try_from( elems: Vec<Param<'a, 'e>>, ) -> Result<Container<'a, 'e>, ConversionError>

Performs the conversion.
Source§

impl<'e, 'a: 'e> Eq for Container<'e, 'a>

Source§

impl<'e, 'a: 'e> StructuralPartialEq for Container<'e, 'a>

Auto Trait Implementations§

§

impl<'e, 'a> Freeze for Container<'e, 'a>

§

impl<'e, 'a> RefUnwindSafe for Container<'e, 'a>

§

impl<'e, 'a> Send for Container<'e, 'a>

§

impl<'e, 'a> Sync for Container<'e, 'a>

§

impl<'e, 'a> Unpin for Container<'e, 'a>

§

impl<'e, 'a> UnwindSafe for Container<'e, 'a>

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.