Trait extendr_api::robj::Length

source ·
pub trait Length: GetSexp {
    // Provided methods
    fn len(&self) -> usize { ... }
    fn is_empty(&self) -> bool { ... }
}

Provided Methods§

source

fn len(&self) -> usize

Get the extended length of the object.

use extendr_api::prelude::*;
test! {

let a : Robj = r!(vec![1., 2., 3., 4.]);
assert_eq!(a.len(), 4);
}
source

fn is_empty(&self) -> bool

Returns true if the Robj contains no elements.

use extendr_api::prelude::*;
test! {

let a : Robj = r!(vec![0.; 0]); // length zero of numeric vector
assert_eq!(a.is_empty(), true);
}

Implementors§

source§

impl Length for Altrep

len() and is_empty()

source§

impl Length for Complexes

len() and is_empty()

source§

impl Length for Doubles

len() and is_empty()

source§

impl Length for Environment

len() and is_empty()

source§

impl Length for Expressions

len() and is_empty()

source§

impl Length for Function

len() and is_empty()

source§

impl Length for Integers

len() and is_empty()

source§

impl Length for Language

len() and is_empty()

source§

impl Length for List

len() and is_empty()

source§

impl Length for Logicals

len() and is_empty()

source§

impl Length for Pairlist

len() and is_empty()

source§

impl Length for Primitive

len() and is_empty()

source§

impl Length for Promise

len() and is_empty()

source§

impl Length for Raw

len() and is_empty()

source§

impl Length for Rstr

len() and is_empty()

source§

impl Length for S4

len() and is_empty()

source§

impl Length for Strings

len() and is_empty()

source§

impl Length for Symbol

len() and is_empty()

source§

impl Length for Robj

source§

impl<T> Length for Dataframe<T>

len() and is_empty()

source§

impl<T: Debug + 'static> Length for ExternalPtr<T>

len() and is_empty()