Struct extendr_api::robj::Robj[][src]

pub struct Robj { /* fields omitted */ }
Expand description

Wrapper for an R S-expression pointer (SEXP).

Create R objects from rust types and iterators:

use extendr_api::prelude::*;
test! {
    // Different ways of making integer scalar 1.
    let non_na : Option<i32> = Some(1);
    let a : Robj = vec![1].into();
    let b = r!(1);
    let c = r!(vec![1]);
    let d = r!(non_na);
    let e = r!([1]);
    assert_eq!(a, b);
    assert_eq!(a, c);
    assert_eq!(a, d);
    assert_eq!(a, e);

    // Different ways of making boolean scalar TRUE.
    let a : Robj = true.into();
    let b = r!(TRUE);
    assert_eq!(a, b);

    // Create a named list
    let a = list!(a = 1, b = "x");
    assert_eq!(a.len(), 2);

    // Use an iterator (like 1:10)
    let a = r!(1 ..= 10);
    assert_eq!(a, r!([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]));

    // Use an iterator (like (1:10)[(1:10) %% 3 == 0])
    let a = (1 ..= 10).filter(|v| v % 3 == 0).collect_robj();
    assert_eq!(a, r!([3, 6, 9]));
}

Convert to/from Rust vectors.

use extendr_api::prelude::*;
test! {
    let a : Robj = r!(vec![1., 2., 3., 4.]);
    let b : Vec<f64> = a.as_real_vector().unwrap();
    assert_eq!(a.len(), 4);
    assert_eq!(b, vec![1., 2., 3., 4.]);
}

Iterate over names and values.

use extendr_api::prelude::*;
test! {
    let abc = list!(a = 1, b = "x", c = vec![1, 2]);
    let names : Vec<_> = abc.names().unwrap().collect();
    let names_and_values : Vec<_> = abc.as_list().unwrap().iter().collect();
    assert_eq!(names, vec!["a", "b", "c"]);
    assert_eq!(names_and_values, vec![("a", r!(1)), ("b", r!("x")), ("c", r!(vec![1, 2]))]);
}

NOTE: as much as possible we wish to make this object safe (ie. no segfaults).

If you avoid using unsafe functions it is more likely that you will avoid panics and segfaults. We will take great trouble to ensure that this is true.

Implementations

Is this object is an NA scalar? Works for character, integer and numeric types.

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

assert_eq!(r!(NA_INTEGER).is_na(), true);
assert_eq!(r!(NA_REAL).is_na(), true);
assert_eq!(r!(NA_STRING).is_na(), true);
}

Get a read-only reference to the content of an integer vector.

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

let robj = r!([1, 2, 3]);
assert_eq!(robj.as_integer_slice().unwrap(), [1, 2, 3]);
}

Convert an Robj into Integers.

Get a Vec copied from the object.

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

let robj = r!([1, 2, 3]);
assert_eq!(robj.as_integer_slice().unwrap(), vec![1, 2, 3]);
}

Get a read-only reference to the content of a logical vector using the tri-state Rbool. Returns None if not a logical vector.

use extendr_api::prelude::*;
test! {
    let robj = r!([TRUE, FALSE]);
    assert_eq!(robj.as_logical_slice().unwrap(), [TRUE, FALSE]);
}

Get a Vec copied from the object using the tri-state Rbool. Returns None if not a logical vector.

use extendr_api::prelude::*;
test! {
    let robj = r!([TRUE, FALSE]);
    assert_eq!(robj.as_logical_vector().unwrap(), vec![TRUE, FALSE]);
}

Get an iterator over logical elements of this slice.

use extendr_api::prelude::*;
test! {
    let robj = r!([TRUE, FALSE, NA_LOGICAL]);
    let mut num_na = 0;
    for val in robj.as_logical_iter().unwrap() {
      if val.is_na() {
          num_na += 1;
      }
    }
    assert_eq!(num_na, 1);
}

Get a read-only reference to the content of a double vector. Note: the slice may contain NaN or NA values. We may introduce a “Real” type to handle this like the Rbool type.

use extendr_api::prelude::*;
test! {
    let robj = r!([Some(1.), None, Some(3.)]);
    let mut tot = 0.;
    for val in robj.as_real_slice().unwrap() {
      if !val.is_na() {
        tot += val;
      }
    }
    assert_eq!(tot, 4.);
}

Get an iterator over real elements of this slice.

use extendr_api::prelude::*;
test! {
    let robj = r!([1., 2., 3.]);
    let mut tot = 0.;
    for val in robj.as_real_iter().unwrap() {
      if !val.is_na() {
        tot += val;
      }
    }
    assert_eq!(tot, 6.);
}

Get a Vec copied from the object.

use extendr_api::prelude::*;
test! {
    let robj = r!([1., 2., 3.]);
    assert_eq!(robj.as_real_vector().unwrap(), vec![1., 2., 3.]);
}

Get a read-only reference to the content of an integer or logical vector.

use extendr_api::prelude::*;
test! {
    let robj = r!(Raw::from_bytes(&[1, 2, 3]));
    assert_eq!(robj.as_raw_slice().unwrap(), &[1, 2, 3]);
}

Get a read-write reference to the content of an integer or logical vector. Note that rust slices are 0-based so slice[1] is the middle value.

use extendr_api::prelude::*;
test! {
    let mut robj = r!([1, 2, 3]);
    let slice : & mut [i32] = robj.as_integer_slice_mut().unwrap();
    slice[1] = 100;
    assert_eq!(robj, r!([1, 100, 3]));
}

Get a read-write reference to the content of a double vector. Note that rust slices are 0-based so slice[1] is the middle value.

use extendr_api::prelude::*;
test! {
    let mut robj = r!([1.0, 2.0, 3.0]);
    let slice = robj.as_real_slice_mut().unwrap();
    slice[1] = 100.0;
    assert_eq!(robj, r!([1.0, 100.0, 3.0]));
}

Get a read-write reference to the content of a raw vector.

use extendr_api::prelude::*;
test! {
    let mut robj = r!(Raw::from_bytes(&[1, 2, 3]));
    let slice = robj.as_raw_slice_mut().unwrap();
    slice[1] = 100;
    assert_eq!(robj, r!(Raw::from_bytes(&[1, 100, 3])));
}

Get a vector of owned strings. Owned strings have long lifetimes, but are much slower than references.

use extendr_api::prelude::*;
test! {
   let robj1 = Robj::from("xyz");
   assert_eq!(robj1.as_string_vector(), Some(vec!["xyz".to_string()]));
   let robj2 = Robj::from(1);
   assert_eq!(robj2.as_string_vector(), None);
}

Get a vector of string references. String references (&str) are faster, but have short lifetimes.

use extendr_api::prelude::*;
test! {
   let robj1 = Robj::from("xyz");
   assert_eq!(robj1.as_str_vector(), Some(vec!["xyz"]));
   let robj2 = Robj::from(1);
   assert_eq!(robj2.as_str_vector(), None);
}

Get a read-only reference to a scalar string type.

use extendr_api::prelude::*;
test! {
   let robj1 = Robj::from("xyz");
   let robj2 = Robj::from(1);
   assert_eq!(robj1.as_str(), Some("xyz"));
   assert_eq!(robj2.as_str(), None);
}

Get a scalar integer.

use extendr_api::prelude::*;
test! {
   let robj1 = Robj::from("xyz");
   let robj2 = Robj::from(1);
   let robj3 = Robj::from(NA_INTEGER);
   assert_eq!(robj1.as_integer(), None);
   assert_eq!(robj2.as_integer(), Some(1));
   assert_eq!(robj3.as_integer(), None);
}

Get a scalar real.

use extendr_api::prelude::*;
test! {
   let robj1 = Robj::from(1);
   let robj2 = Robj::from(1.);
   let robj3 = Robj::from(NA_REAL);
   assert_eq!(robj1.as_real(), None);
   assert_eq!(robj2.as_real(), Some(1.));
   assert_eq!(robj3.as_real(), None);
}

Get a scalar rust boolean.

use extendr_api::prelude::*;
test! {
   let robj1 = Robj::from(TRUE);
   let robj2 = Robj::from(1.);
   let robj3 = Robj::from(NA_LOGICAL);
   assert_eq!(robj1.as_bool(), Some(true));
   assert_eq!(robj2.as_bool(), None);
   assert_eq!(robj3.as_bool(), None);
}

Get a scalar boolean as a tri-boolean Rbool value.

use extendr_api::prelude::*;
test! {
   let robj1 = Robj::from(TRUE);
   let robj2 = Robj::from([TRUE, FALSE]);
   let robj3 = Robj::from(NA_LOGICAL);
   assert_eq!(robj1.as_logical(), Some(TRUE));
   assert_eq!(robj2.as_logical(), None);
   assert_eq!(robj3.as_logical().unwrap().is_na(), true);
}

Trait Implementations

Add two R objects, consuming the left hand side. panics on error.

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

// lhs and rhs get dropped here
let lhs = r!([1, 2]);
let rhs = r!([10, 20]);
assert_eq!(lhs + rhs, r!([11, 22]));

// lhs gets dropped and rhs is a temporary object.
let lhs = r!([1, 2]);
assert_eq!(lhs + 1000, r!([1001, 1002]));

// Only lhs gets dropped.
let lhs = r!([1, 2]);
let rhs = r!([10, 20]);
assert_eq!(lhs + &rhs, r!([11, 22]));
}

The resulting type after applying the + operator.

Get an iterator over a string vector. Returns None if the object is not a string vector but works for factors. Read more

Get a specific attribute as a borrowed robj if it exists. Read more

Return true if an attribute exists.

Set a specific attribute and return the object. Read more

Get the names attribute as a string iterator if one exists. Read more

Return true if this object has names.

Set the names attribute from a string iterator. Read more

Get the dim attribute as an integer iterator if one exists. Read more

Get the dimnames attribute as a list iterator if one exists. Read more

Get the class attribute as a string iterator if one exists. Read more

Set the class attribute from a string iterator, returning a new object. Read more

Return true if this class inherits this class. Read more

Get the levels attribute as a string iterator if one exists. Read more

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Convert a symbol object to a Symbol wrapper. Read more

Convert a CHARSXP object to a Rstr wrapper. Read more

Convert a raw object to a Rstr wrapper. Read more

Convert a language object to a Language wrapper. Read more

Convert a pair list object (LISTSXP) to a Pairlist wrapper. Read more

Convert a list object (VECSXP) to a List wrapper. Read more

Convert an expression object (EXPRSXP) to a Expr wrapper. Read more

Convert an environment object (ENVSXP) to a Env wrapper. Read more

Convert a function object (CLOSXP) to a Function wrapper. Read more

Get a wrapper for a promise.

Implement {:?} formatting.

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Divide two R objects, consuming the left hand side. panics on error.

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

// lhs and rhs get dropped here
let lhs = r!([10.0, 20.0]);
let rhs = r!([1.0, 2.0]);
assert_eq!(lhs / rhs, r!([10.0, 10.0]));

// lhs gets dropped and rhs is a temporary object.
let lhs = r!([10.0, 30.0]);
assert_eq!(lhs / 10.0, r!([1.0, 3.0]));

// Only lhs gets dropped.
let lhs = r!([10.0, 20.0]);
let rhs = r!([1.0, 2.0]);
assert_eq!(lhs / &rhs, r!([10.0, 10.0]));
}

The resulting type after applying the / operator.

Release any owned objects.

Executes the destructor for this type. Read more

Evaluate the expression in R and return an error or an R object. Read more

Evaluate the expression in R and return an error or an R object. Read more

Evaluate the expression and return NULL or an R object. Read more

Convert an Robj reference into a borrowed Robj.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Convert a null to an Robj.

Performs the conversion.

Make an robj from a wrapper.

Performs the conversion.

Make an robj from a wrapper.

Make an robj from a wrapper.

Make an robj from a wrapper.

Make an robj from a wrapper.

Performs the conversion.

Performs the conversion.

Make an robj from a wrapper.

Performs the conversion.

Make an robj from a wrapper.

Make an robj from a wrapper.

Make an robj from a wrapper.

You can return a ListIter from a function.

use extendr_api::prelude::*;
test! {
    let listiter = list!(1, 2).values();
    assert_eq!(Robj::from(listiter), Robj::from(list!(1, 2)));
}

Make an robj from a wrapper.

Performs the conversion.

Convert a rust object to NULL or another type.

use extendr_api::prelude::*;
test! {
    assert_eq!(r!(Nullable::<i32>::Null), r!(NULL));
    assert_eq!(r!(Nullable::<i32>::NotNull(1)), r!(1));
}

Make an robj from a wrapper.

You can return a PairlistIter from a function.

Make an robj from a wrapper.

Make an robj from a wrapper.

Convert a column, matrix or matrix3d to an Robj.

Performs the conversion.

Performs the conversion.

Make an robj from a wrapper.

Convert a Result to an Robj. This is used to allow functions to use the ? operator and return Result.

Panics if there is an error.

use extendr_api::prelude::*;
fn my_func() -> Result<f64> {
    Ok(1.0)
}

test! {
    assert_eq!(r!(my_func()), r!(1.0));
}

Performs the conversion.

Performs the conversion.

Performs the conversion.

Make an robj from a wrapper.

Make an robj from a wrapper.

Make an robj from a wrapper.

Make an robj from a wrapper.

Performs the conversion.

Convert a vector of Robj into a list.

Performs the conversion.

Pass-through Robj conversion, essentially a clone.

Get a copy of the underlying SEXP. Read more

Get a reference to a Robj for this type.

Get a mutable reference to a Robj for this type.

Get the extended length of the object. Read more

Returns true if the Robj contains no elements. Read more

Multiply two R objects, consuming the left hand side. panics on error.

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

// lhs and rhs get dropped here
let lhs = r!([10.0, 20.0]);
let rhs = r!([1.0, 2.0]);
assert_eq!(lhs * rhs, r!([10.0, 40.0]));

// lhs gets dropped and rhs is a temporary object.
let lhs = r!([1.0, 2.0]);
assert_eq!(lhs * 10.0, r!([10.0, 20.0]));

// Only lhs gets dropped.
let lhs = r!([10.0, 20.0]);
let rhs = r!([1.0, 2.0]);
assert_eq!(lhs * &rhs, r!([10.0, 40.0]));
}

The resulting type after applying the * operator.

Do the equivalent of x$y Read more

Do the equivalent of x[y] Read more

Do the equivalent of x[[y]] Read more

Do the equivalent of x ~ y Read more

Do the equivalent of x :: y Read more

Do the equivalent of x(a, b, c) Read more

Compare equality with slices of double.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Compare equality with integer slices.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Compare equality with two Robjs.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Compare equality with strings.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Return true if this is the null object.

Return true if this is a symbol.

Return true if this is a boolean (logical) vector

Return true if this is a real (f64) vector.

Return true if this is a complex vector.

Return true if this is an expression.

Return true if this is an environment.

Return true if this is an environment.

Return true if this is a string.

Return true if this is an object (ie. has a class attribute).

Return true if this is a S4 object.

Return true if this is an expression.

Get the source ref.

Get the source filename.

Convert to a string vector.

Convert to vectors of many kinds.

Convert a pairlist (LISTSXP) to a vector list (VECSXP).

Convert a vector list (VECSXP) to a pair list (LISTSXP)

Convert a factor to a string vector.

Allocate a matrix object.

Do a deep copy of this object. Note that clone() only adds a reference. Read more

Find a function in an environment ignoring other variables. Read more

Find a variable in an environment. Read more

If this object is a promise, evaluate it, otherwise return the object. Read more

Number of columns of a matrix

Number of rows of a matrix

Allocated an owned object of a certain type.

Return true if two arrays have identical dims.

Return true if this is an array.

Return true if this is factor.

Return true if this is a data frame.

Return true if this is a function or a primitive (CLOSXP, BUILTINSXP or SPECIALSXP)

Return true if this is an integer vector (INTSXP) but not a factor.

Return true if this is a language object (LANGSXP).

Return true if this is NILSXP or LISTSXP.

Return true if this is a matrix.

Return true if this is NILSXP or VECSXP.

Return true if this is INTSXP, LGLSXP or REALSXP but not a factor.

Return true if this is a primitive function BUILTINSXP, SPECIALSXP.

Return true if this is a time series vector (see tsp).

Return true if this is a user defined binop.

Return true if this is a valid string.

Return true if this is a valid string.

Return true if this is a vector.

Return true if this is an atomic vector.

Return true if this is a vector list.

Return true if this is can be made into a vector.

Return true if this is RAWSXP.

Return true if this is CHARSXP.

Returns true if this is an ALTREP object.

Returns true if this is an integer ALTREP object.

Returns true if this is an real ALTREP object.

Returns true if this is an logical ALTREP object.

Returns true if this is a raw ALTREP object.

Returns true if this is an integer ALTREP object.

Generate a text representation of this object.

Serialize this value into the given Serde serializer. Read more

Get an immutable slice to this object’s data. Read more

Get a mutable slice to this object’s data. Read more

Subtract two R objects, consuming the left hand side. panics on error.

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

// lhs and rhs get dropped here
let lhs = r!([10, 20]);
let rhs = r!([1, 2]);
assert_eq!(lhs - rhs, r!([9, 18]));

// lhs gets dropped and rhs is a temporary object.
let lhs = r!([1000, 2000]);
assert_eq!(lhs - 1, r!([999, 1999]));

// Only lhs gets dropped.
let lhs = r!([10, 20]);
let rhs = r!([1, 2]);
assert_eq!(lhs - &rhs, r!([9, 18]));
}

The resulting type after applying the - operator.

The type returned in the event of a conversion error.

Performs the conversion.

Convert a numeric object to an integer value.

The type returned in the event of a conversion error.

Convert a numeric object to an integer value.

The type returned in the event of a conversion error.

Convert an LGLSXP object into a Rbool (tri-state boolean). Use value.is_na() to detect NA values.

The type returned in the event of a conversion error.

Convert an LGLSXP object into a boolean. NAs are not allowed.

The type returned in the event of a conversion error.

Convert a scalar STRSXP object into a string slice. NAs are not allowed.

The type returned in the event of a conversion error.

Convert an scalar STRSXP object into a String. Note: Unless you plan to store the result, use a string slice instead. NAs are not allowed.

The type returned in the event of a conversion error.

Convert an INTSXP object into a vector of i32 (integer). Note: Unless you plan to store the result, use a slice instead. Use value.is_na() to detect NA values.

The type returned in the event of a conversion error.

Convert a REALSXP object into a vector of f64 (double precision floating point). Note: Unless you plan to store the result, use a slice instead. Use value.is_na() to detect NA values.

The type returned in the event of a conversion error.

Convert a LGLSXP object into a vector of Rbool (tri-state booleans). Note: Unless you plan to store the result, use a slice instead. Use value.is_na() to detect NA values.

The type returned in the event of a conversion error.

Convert a RAWSXP object into a vector of bytes. Note: Unless you plan to store the result, use a slice instead.

The type returned in the event of a conversion error.

Convert a STRSXP object into a vector of Strings. Note: Unless you plan to store the result, use a slice instead.

The type returned in the event of a conversion error.

Convert a scalar object that may be NA type to an Option of a corresponding type. Returns None if the scalar is NA.

The type returned in the event of a conversion error.

Convert a numeric object to an integer value.

The type returned in the event of a conversion error.

Convert a scalar object that may be NA type to an Option of a corresponding type. Returns None if the scalar is NA.

The type returned in the event of a conversion error.

Convert a scalar object that may be NA type to an Option of a corresponding type. Returns None if the scalar is NA.

The type returned in the event of a conversion error.

Convert a scalar object that may be NA type to an Option of a corresponding type. Returns None if the scalar is NA.

The type returned in the event of a conversion error.

Convert a scalar object that may be NA type to an Option of a corresponding type. Returns None if the scalar is NA.

The type returned in the event of a conversion error.

Convert a scalar object that may be NA type to an Option of a corresponding type. Returns None if the scalar is NA.

The type returned in the event of a conversion error.

Convert a scalar object that may be NA type to an Option of a corresponding type. Returns None if the scalar is NA.

The type returned in the event of a conversion error.

Convert a scalar object that may be NA type to an Option of a corresponding type. Returns None if the scalar is NA.

The type returned in the event of a conversion error.

Convert a scalar object that may be NA type to an Option of a corresponding type. Returns None if the scalar is NA.

The type returned in the event of a conversion error.

Convert a scalar object that may be NA type to an Option of a corresponding type. Returns None if the scalar is NA.

The type returned in the event of a conversion error.

Convert a scalar object that may be NA type to an Option of a corresponding type. Returns None if the scalar is NA.

The type returned in the event of a conversion error.

Convert a numeric object to an integer value.

The type returned in the event of a conversion error.

Convert a scalar object that may be NA type to an Option of a corresponding type. Returns None if the scalar is NA.

The type returned in the event of a conversion error.

Convert a scalar object that may be NA type to an Option of a corresponding type. Returns None if the scalar is NA.

The type returned in the event of a conversion error.

Convert a scalar object that may be NA type to an Option of a corresponding type. Returns None if the scalar is NA.

The type returned in the event of a conversion error.

Convert a scalar object that may be NA type to an Option of a corresponding type. Returns None if the scalar is NA.

The type returned in the event of a conversion error.

Convert a scalar object that may be NA type to an Option of a corresponding type. Returns None if the scalar is NA.

The type returned in the event of a conversion error.

Convert a scalar object that may be NA type to an Option of a corresponding type. Returns None if the scalar is NA.

The type returned in the event of a conversion error.

Convert an INTSXP object into a slice of i32 (integer). Use value.is_na() to detect NA values.

The type returned in the event of a conversion error.

Convert a LGLSXP object into a slice of Rbool (tri-state booleans). Use value.is_na() to detect NA values.

The type returned in the event of a conversion error.

Convert a RAWSXP object into a slice of bytes.

The type returned in the event of a conversion error.

Convert a REALSXP object into a slice of f64 (double precision floating point). Use value.is_na() to detect NA values.

The type returned in the event of a conversion error.

Convert a numeric object to an integer value.

The type returned in the event of a conversion error.

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.

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.

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.

You can pass a ListIter to a function.

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

The type returned in the event of a conversion error.

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.

The type returned in the event of a conversion error.

Performs the conversion.

You can pass a PairlistIter to a function.

The type returned in the event of a conversion error.

Convert a numeric object to an integer value.

The type returned in the event of a conversion error.

Make a wrapper from a robj if it matches.

The type returned in the event of a conversion error.

Make a wrapper from a robj if it matches.

The type returned in the event of a conversion error.

Make a wrapper from a robj if it matches.

The type returned in the event of a conversion error.

Make a wrapper from a robj if it matches.

The type returned in the event of a conversion error.

Make a wrapper from a robj if it matches.

The type returned in the event of a conversion error.

Make a wrapper from a robj if it matches.

The type returned in the event of a conversion error.

Make a wrapper from a robj if it matches.

The type returned in the event of a conversion error.

Make a wrapper from a robj if it matches.

The type returned in the event of a conversion error.

Make a wrapper from a robj if it matches.

The type returned in the event of a conversion error.

Make a wrapper from a robj if it matches.

The type returned in the event of a conversion error.

Convert a numeric object to an integer value.

The type returned in the event of a conversion error.

Make a wrapper from a robj if it matches.

The type returned in the event of a conversion error.

Make a wrapper from a robj if it matches.

The type returned in the event of a conversion error.

Make a wrapper from a robj if it matches.

The type returned in the event of a conversion error.

Make a wrapper from a robj if it matches.

The type returned in the event of a conversion error.

Make a wrapper from a robj if it matches.

The type returned in the event of a conversion error.

Make a wrapper from a robj if it matches.

The type returned in the event of a conversion error.

Make a wrapper from a robj if it matches.

The type returned in the event of a conversion error.

Make a wrapper from a robj if it matches.

The type returned in the event of a conversion error.

Convert a numeric object to an integer value.

The type returned in the event of a conversion error.

Convert a numeric object to a real value.

The type returned in the event of a conversion error.

Convert a numeric object to a real value.

The type returned in the event of a conversion error.

Get the type of an R object. Read more

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 resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

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.