[][src]Struct zvariant::Array

pub struct Array<'a> { /* fields omitted */ }

A helper type to wrap arrays in a Value.

API is provided to convert from, and to a Vec.

Implementations

impl<'a> Array<'a>[src]

pub fn new(element_signature: Signature<'_>) -> Array<'_>[src]

Create a new empty Array, given the signature of the elements.

pub fn append<'e: 'a>(&mut self, element: Value<'e>) -> Result<()>[src]

Append element.

Errors

if element's signature doesn't match the element signature self was created for.

pub fn get(&self) -> &[Value<'a>][src]

Get all the elements.

pub fn len(&self) -> usize[src]

Get the number of elements.

pub fn is_empty(&self) -> bool[src]

pub fn signature(&self) -> Signature<'static>[src]

Get the signature of this Array.

NB: This method potentially allocates and copies. Use full_signature if you'd like to avoid that.

pub fn full_signature(&self) -> &Signature<'_>[src]

Get the signature of this Array.

pub fn element_signature(&self) -> &Signature<'_>[src]

Get the signature of the elements in the Array.

Trait Implementations

impl<'a> Clone for Array<'a>[src]

impl<'a> Debug for Array<'a>[src]

impl<'a> Deref for Array<'a>[src]

type Target = [Value<'a>]

The resulting type after dereferencing.

impl<'a, T, '_> From<&'_ [T]> for Array<'a> where
    T: Type + Into<Value<'a>> + Clone
[src]

impl<'a, T, '_> From<&'_ Vec<T>> for Array<'a> where
    T: Type + Into<Value<'a>> + Clone
[src]

impl<'a> From<&'a Array<'a>> for Value<'a>[src]

impl<'a> From<Array<'a>> for Value<'a>[src]

impl<'a, T> From<Vec<T>> for Array<'a> where
    T: Type + Into<Value<'a>>, 
[src]

impl<'a> PartialEq<Array<'a>> for Array<'a>[src]

impl<'a> Serialize for Array<'a>[src]

impl<'a> StructuralPartialEq for Array<'a>[src]

impl<'a> TryFrom<&'a OwnedValue> for &'a Array<'a>[src]

type Error = Error

The type returned in the event of a conversion error.

impl<'a> TryFrom<&'a Value<'a>> for &'a Array<'a>[src]

type Error = Error

The type returned in the event of a conversion error.

impl<'a> TryFrom<&'a Value<'a>> for Array<'a>[src]

type Error = Error

The type returned in the event of a conversion error.

impl<'a, T> TryFrom<Array<'a>> for Vec<T> where
    T: TryFrom<Value<'a>>, 
[src]

type Error = Error

The type returned in the event of a conversion error.

impl<'a> TryFrom<OwnedValue> for Array<'a>[src]

type Error = Error

The type returned in the event of a conversion error.

impl<'a> TryFrom<Value<'a>> for Array<'a>[src]

type Error = Error

The type returned in the event of a conversion error.

Auto Trait Implementations

impl<'a> RefUnwindSafe for Array<'a>

impl<'a> Send for Array<'a>

impl<'a> Sync for Array<'a>

impl<'a> Unpin for Array<'a>

impl<'a> UnwindSafe for Array<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.