logo
pub struct Robj { /* private fields */ }
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

A ref of an robj can be constructed from a ref to a SEXP as they have the same layout.

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

Deserialize this value from the given Serde deserializer. Read more

The error type that can be returned if some error occurs during deserialization. Read more

Require the Deserializer to figure out how to drive the visitor based on what data type is in the input. Read more

Hint that the Deserialize type is expecting a unit value.

Hint that the Deserialize type is expecting a bool value.

Hint that the Deserialize type is expecting an i8 value.

Hint that the Deserialize type is expecting an i16 value.

Hint that the Deserialize type is expecting an i32 value.

Hint that the Deserialize type is expecting an i64 value.

Hint that the Deserialize type is expecting an i128 value. Read more

Hint that the Deserialize type is expecting a u8 value.

Hint that the Deserialize type is expecting a u16 value.

Hint that the Deserialize type is expecting a u32 value.

Hint that the Deserialize type is expecting a u64 value.

Hint that the Deserialize type is expecting an u128 value. Read more

Hint that the Deserialize type is expecting a f32 value.

Hint that the Deserialize type is expecting a f64 value.

Hint that the Deserialize type is expecting a char value.

Hint that the Deserialize type is expecting a string value and does not benefit from taking ownership of buffered data owned by the Deserializer. Read more

Hint that the Deserialize type is expecting a string value and would benefit from taking ownership of buffered data owned by the Deserializer. Read more

Hint that the Deserialize type is expecting a byte array and does not benefit from taking ownership of buffered data owned by the Deserializer. Read more

Hint that the Deserialize type is expecting a byte array and would benefit from taking ownership of buffered data owned by the Deserializer. Read more

Hint that the Deserialize type is expecting an optional value. Read more

Hint that the Deserialize type is expecting a unit struct with a particular name. Read more

Hint that the Deserialize type is expecting a newtype struct with a particular name. Read more

Hint that the Deserialize type is expecting a sequence of values and knows how many values there are without looking at the serialized data. Read more

Hint that the Deserialize type is expecting a tuple struct with a particular name and number of fields. Read more

Hint that the Deserialize type is expecting a sequence of values.

Hint that the Deserialize type is expecting a map of key-value pairs.

Hint that the Deserialize type is expecting a struct with a particular name and fields. Read more

Hint that the Deserialize type is expecting the name of a struct field or the discriminant of an enum variant. Read more

Hint that the Deserialize type needs to deserialize a value whose type doesn’t matter because it is ignored. Read more

Hint that the Deserialize type is expecting an enum value with a particular name and possible variants. Read more

Determine whether Deserialize implementations should expect to deserialize their human-readable form. 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

The error type that can be returned if some error occurs during deserialization. Read more

The Visitor that will be used to deserialize the content of the enum variant. Read more

variant is called to identify which variant to deserialize. Read more

variant is called to identify which variant to deserialize. 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

Make an robj from a wrapper.

Make an robj from a wrapper.

Make an robj from a wrapper.

Make an robj from a wrapper.

Make an robj from a wrapper.

Make an robj from a wrapper.

Make an robj from a wrapper.

Make an robj from a wrapper.

Make an robj from a wrapper.

Make an robj from a wrapper.

Make an robj from a wrapper.

Make an robj from a wrapper.

Make an robj from a wrapper.

Make an robj from a wrapper.

Convert an Robj reference into a borrowed Robj.

Converts to this type from the input type.

Make an robj from a wrapper.

Make an robj from a wrapper.

Make an robj from a wrapper.

Make an robj from a wrapper.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Convert a null to an Robj.

Converts to this type from the input type.

Make an robj from a wrapper.

Converts to this type from the input type.

Make an robj from a wrapper.

Make an robj from a wrapper.

Make an robj from a wrapper.

Make an robj from a wrapper.

Converts to this type from the input type.

Converts to this type from the input type.

Make an robj from a wrapper.

Converts to this type from the input type.

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.

Converts to this type from the input type.

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.

Converts to this type from the input type.

Converts to this type from the input type.

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));
}

Converts to this type from the input type.

Converts to this type from the input type.

Converts to this type from the input type.

Make an robj from a wrapper.

Make an robj from a wrapper.

Make an robj from a wrapper.

Make an robj from a wrapper.

Converts to this type from the input type.

Convert a vector of Rfloat into doubles.

Convert a vector of Rint into integers.

Convert a vector of Robj into a list.

Convert a vector of Rstr into strings.

Converts to this type from the input type.

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

Save an object in the R data format. version should probably be 3. Read more

Save an object in the R data format to a Write trait. version should probably be 3. 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 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.

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 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 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 numeric object to an integer value.

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 complex object into a vector of Rcplx.

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 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 an integer object into a slice of Rint (tri-state booleans). Use value.is_na() to detect NA values.

The type returned in the event of a conversion error.

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

The type returned in the event of a conversion error.

Convert a logical 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 complex object into a slice of Rbool 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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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 general R object into a List iterator if possible.

The type returned in the event of a conversion error.

You can pass a PairlistIter to a function.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

Convert a general R object into a List iterator if possible.

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.

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.

The type returned in the event of a conversion error.

Performs the conversion.

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.

The type returned in the event of a conversion error.

Performs the conversion.

Make a wrapper from a robj if it matches.

The type returned in the event of a conversion error.

Get the type of an R object. Read more

The error type that can be returned if some error occurs during deserialization. Must match the error type of our EnumAccess. Read more

Called when deserializing a variant with no values. Read more

Called when deserializing a variant with a single value. Read more

Called when deserializing a tuple-like variant. Read more

Called when deserializing a struct-like variant. Read more

Called when deserializing a variant with a single value. 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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.