Struct extendr_api::wrapper::List[][src]

pub struct List<T>(pub T);

Wrapper for creating list (VECSXP) objects.

use extendr_api::prelude::*;
test! {
    let list = r!(List(&[r!(0), r!(1), r!(2)]));
    assert_eq!(list.is_list(), true);
    assert_eq!(list.len(), 3);
    assert_eq!(format!("{:?}", list), r#"r!(List([r!(0), r!(1), r!(2)]))"#);
}

Note: you can use the list! macro for named lists.

Trait Implementations

impl<T: Clone> Clone for List<T>[src]

impl<T: Debug> Debug for List<T>[src]

impl<T> From<List<T>> for Robj where
    T: IntoIterator,
    T::IntoIter: ExactSizeIterator,
    T::Item: Into<Robj>, 
[src]

fn from(val: List<T>) -> Self[src]

Make a list object from an iterator of Robjs.

use extendr_api::prelude::*;
test! {
    let list_of_ints = r!(List(&[1, 2]));
    assert_eq!(list_of_ints.len(), 2);
}

impl<T: PartialEq> PartialEq<List<T>> for List<T>[src]

impl<T> StructuralPartialEq for List<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for List<T> where
    T: RefUnwindSafe
[src]

impl<T> Send for List<T> where
    T: Send
[src]

impl<T> Sync for List<T> where
    T: Sync
[src]

impl<T> Unpin for List<T> where
    T: Unpin
[src]

impl<T> UnwindSafe for List<T> where
    T: UnwindSafe
[src]

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.