Struct extendr_api::wrapper::list::FromList[][src]

pub struct FromList<T>(pub T);
Expand description

You can use the FromList wrapper to coerce a Robj into a list.

use extendr_api::prelude::*;
test! {
    let list = Robj::from(list!(1, 2));
    let vec : FromList<Vec<i32>> = list.try_into()?;
    assert_eq!(vec.0, vec![1, 2]);
}

Tuple Fields

0: T

Trait Implementations

You can use the FromList wrapper to coerce a Robj into a list.

use extendr_api::prelude::*;
test! {
    let list = Robj::from(list!(1, 2));
    let vec : FromList<Vec<i32>> = list.try_into()?;
    assert_eq!(vec.0, vec![1, 2]);
}

The type returned in the event of a conversion error.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.