Skip to main content

Module adapter_traits

Module adapter_traits 

Source
Expand description

Built-in adapter traits for std library traits.

Provides RDebug, RDisplay, RHash, ROrd, RPartialOrd, RError, RFromStr, RClone, RCopy, RDefault, RIterator, RExtend, and RFromIter with blanket implementations where possible. See module docs for usage.

Built-in adapter traits for common Rust standard library traits.

These traits provide blanket implementations that allow any Rust type implementing standard traits to be exposed to R without boilerplate.

§Example

use miniextendr_api::prelude::*;
use miniextendr_api::adapter_traits::RDebug;

#[derive(Debug, ExternalPtr)]
struct MyData {
    values: Vec<i32>,
}

// RDebug is automatically available for any Debug type
#[miniextendr]
impl RDebug for MyData {}

In R:

data <- MyData$new(...)
data$debug_str()        # "MyData { values: [1, 2, 3] }"
data$debug_str_pretty() # Pretty-printed with newlines

Structs§

RCloneView
Runtime view for objects implementing RClone. Generated from source location line 368, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
RCopyView
Runtime view for objects implementing RCopy. Generated from source location line 454, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
RDebugView
Runtime view for objects implementing RDebug. Generated from source location line 55, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
RDefaultView
Runtime view for objects implementing RDefault. Generated from source location line 407, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
RDisplayView
Runtime view for objects implementing RDisplay. Generated from source location line 97, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
RErrorView
Runtime view for objects implementing RError. Generated from source location line 264, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
RFromStrView
Runtime view for objects implementing RFromStr. Generated from source location line 328, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
RHashView
Runtime view for objects implementing RHash. Generated from source location line 132, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
RIteratorView
Runtime view for objects implementing RIterator. Generated from source location line 540, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
ROrdView
Runtime view for objects implementing ROrd. Generated from source location line 164, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
RPartialOrdView
Runtime view for objects implementing RPartialOrd. Generated from source location line 204, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.

Constants§

TAG_RCLONE
Type tag for runtime identification of the RClone trait. Generated from source location line 368, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
TAG_RCOPY
Type tag for runtime identification of the RCopy trait. Generated from source location line 454, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
TAG_RDEBUG
Type tag for runtime identification of the RDebug trait. Generated from source location line 55, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
TAG_RDEFAULT
Type tag for runtime identification of the RDefault trait. Generated from source location line 407, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
TAG_RDISPLAY
Type tag for runtime identification of the RDisplay trait. Generated from source location line 97, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
TAG_RERROR
Type tag for runtime identification of the RError trait. Generated from source location line 264, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
TAG_REXTEND
Type tag for runtime identification of the RExtend trait. Generated from source location line 666, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
TAG_RFROMITER
Type tag for runtime identification of the RFromIter trait. Generated from source location line 733, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
TAG_RFROMSTR
Type tag for runtime identification of the RFromStr trait. Generated from source location line 328, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
TAG_RHASH
Type tag for runtime identification of the RHash trait. Generated from source location line 132, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
TAG_RITERATOR
Type tag for runtime identification of the RIterator trait. Generated from source location line 540, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
TAG_RMAKEITER
Type tag for runtime identification of the RMakeIter trait. Generated from source location line 882, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
TAG_RORD
Type tag for runtime identification of the ROrd trait. Generated from source location line 164, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
TAG_RPARTIALORD
Type tag for runtime identification of the RPartialOrd trait. Generated from source location line 204, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
TAG_RTOVEC
Type tag for runtime identification of the RToVec trait. Generated from source location line 787, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.

Traits§

RClone
Adapter trait for std::clone::Clone.
RCopy
Adapter trait for std::marker::Copy.
RDebug
Adapter trait for std::fmt::Debug.
RDefault
Adapter trait for std::default::Default.
RDisplay
Adapter trait for std::fmt::Display.
RError
Adapter trait for std::error::Error.
RExtend
Adapter trait for std::iter::Extend.
RFromIter
Adapter trait for std::iter::FromIterator.
RFromStr
Adapter trait for std::str::FromStr.
RHash
Adapter trait for std::hash::Hash.
RIterator
Adapter trait for std::iter::Iterator.
RMakeIter
Adapter trait for creating iterator wrappers from collections.
ROrd
Adapter trait for std::cmp::Ord.
RPartialOrd
Adapter trait for std::cmp::PartialOrd.
RToVec
Adapter trait for collections that can be converted to vectors.

Functions§

__rclone_build_vtable
Build a vtable for a concrete type implementing RClone. Generated from source location line 368, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
__rcopy_build_vtable
Build a vtable for a concrete type implementing RCopy. Generated from source location line 454, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
__rdebug_build_vtable
Build a vtable for a concrete type implementing RDebug. Generated from source location line 55, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
__rdefault_build_vtable
Build a vtable for a concrete type implementing RDefault. Generated from source location line 407, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
__rdisplay_build_vtable
Build a vtable for a concrete type implementing RDisplay. Generated from source location line 97, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
__rerror_build_vtable
Build a vtable for a concrete type implementing RError. Generated from source location line 264, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
__rfromstr_build_vtable
Build a vtable for a concrete type implementing RFromStr. Generated from source location line 328, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
__rhash_build_vtable
Build a vtable for a concrete type implementing RHash. Generated from source location line 132, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
__riterator_build_vtable
Build a vtable for a concrete type implementing RIterator. Generated from source location line 540, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
__rord_build_vtable
Build a vtable for a concrete type implementing ROrd. Generated from source location line 164, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.
__rpartialord_build_vtable
Build a vtable for a concrete type implementing RPartialOrd. Generated from source location line 204, column 11. Generated from source file miniextendr-api/src/adapter_traits.rs.