Expand description
Built-in adapter traits for std library traits.
Provides RDebug, RDisplay, RHash, ROrd, RPartialOrd,
RError, RFromStr, RClone, RCopy, RDefault, RIterator,
RExtend, RFromIter, RToVec, and RMakeIter with blanket
implementations where possible. Methods that share a name with a std
method are r_-prefixed in Rust and keep the std name in R, so importing
these traits leaves std calls alone. 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::*;
#[derive(Debug, ExternalPtr)]
struct MyData {
values: Vec<i32>,
}
// RDebug is automatically available for any Debug type
#[miniextendr]
impl miniextendr_api::adapter_traits::RDebug for MyData {}In R:
data <- MyData$new(...)
data$RDebug$debug_str() # "MyData { values: [1, 2, 3] }"
data$RDebug$debug_str_pretty() # Pretty-printed with newlines§Rust method names
A method whose name a std trait or a covered type already uses gets an
r_ prefix in Rust and keeps the std name in R through
#[miniextendr(r_name = "...")]: RClone::r_clone is clone() in R.
The blanket impls cover every Clone, Default, Hash, Ord,
PartialOrd and FromStr type, and RToVec every array and boxed slice,
so with the std names an import of these traits would make the importing
module’s own v.clone() or a.cmp(&b) ambiguous (E0034), and its
[T; N]::len() an i64.
Both empty and populated #[miniextendr] impl blocks inherit the trait’s
R names and skipped methods. This includes generic RToVec<T> and
RExtend<T> and the associated-type RIterator. An explicit impl-level
r_name overrides the declaration’s name for that implementation.
Re-exports§
pub use __mx_trait_metadata_RDebug_0 as RDebug;👻pub use __mx_trait_metadata_RDisplay_1 as RDisplay;👻pub use __mx_trait_metadata_RHash_2 as RHash;👻pub use __mx_trait_metadata_ROrd_3 as ROrd;👻pub use __mx_trait_metadata_RPartialOrd_4 as RPartialOrd;👻pub use __mx_trait_metadata_RError_5 as RError;👻pub use __mx_trait_metadata_RFromStr_6 as RFromStr;👻pub use __mx_trait_metadata_RClone_7 as RClone;👻pub use __mx_trait_metadata_RDefault_8 as RDefault;👻pub use __mx_trait_metadata_RCopy_9 as RCopy;👻pub use __mx_trait_metadata_RIterator_10 as RIterator;👻pub use __mx_trait_metadata_RExtend_11 as RExtend;👻pub use __mx_trait_metadata_RFromIter_12 as RFromIter;👻pub use __mx_trait_metadata_RToVec_13 as RToVec;👻pub use __mx_trait_metadata_RMakeIter_14 as RMakeIter;👻
Structs§
- RCloneV
Table 👻 - Vtable for the
RClonetrait. Generated from source location line 404, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - RClone
View - Runtime view for objects implementing
RClone. Generated from source location line 404, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - RCopyV
Table 👻 - Vtable for the
RCopytrait. Generated from source location line 493, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - RCopy
View - Runtime view for objects implementing
RCopy. Generated from source location line 493, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - RDebugV
Table 👻 - Vtable for the
RDebugtrait. Generated from source location line 71, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - RDebug
View - Runtime view for objects implementing
RDebug. Generated from source location line 71, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - RDefaultV
Table 👻 - Vtable for the
RDefaulttrait. Generated from source location line 445, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - RDefault
View - Runtime view for objects implementing
RDefault. Generated from source location line 445, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - RDisplayV
Table 👻 - Vtable for the
RDisplaytrait. Generated from source location line 113, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - RDisplay
View - Runtime view for objects implementing
RDisplay. Generated from source location line 113, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - RErrorV
Table 👻 - Vtable for the
RErrortrait. Generated from source location line 298, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - RError
View - Runtime view for objects implementing
RError. Generated from source location line 298, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - RExtendV
Table 👻 - Vtable for the
RExtendtrait. Generated from source location line 778, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - RFrom
IterV 👻Table - Vtable for the
RFromItertrait. Generated from source location line 845, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - RFrom
StrV 👻Table - Vtable for the
RFromStrtrait. Generated from source location line 363, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - RFrom
StrView - Runtime view for objects implementing
RFromStr. Generated from source location line 363, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - RHashV
Table 👻 - Vtable for the
RHashtrait. Generated from source location line 156, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - RHash
View - Runtime view for objects implementing
RHash. Generated from source location line 156, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - RIteratorV
Table 👻 - Vtable for the
RIteratortrait. Generated from source location line 601, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - RIterator
View - Runtime view for objects implementing
RIterator. Generated from source location line 601, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - RMake
IterV 👻Table - Vtable for the
RMakeItertrait. Generated from source location line 1001, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - ROrdV
Table 👻 - Vtable for the
ROrdtrait. Generated from source location line 195, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - ROrd
View - Runtime view for objects implementing
ROrd. Generated from source location line 195, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - RPartial
OrdV 👻Table - Vtable for the
RPartialOrdtrait. Generated from source location line 237, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - RPartial
OrdView - Runtime view for objects implementing
RPartialOrd. Generated from source location line 237, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - RToVecV
Table 👻 - Vtable for the
RToVectrait. Generated from source location line 915, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs.
Constants§
- TAG_
RClone - Type tag for runtime identification of the
RClonetrait. Generated from source location line 404, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - TAG_
RCopy - Type tag for runtime identification of the
RCopytrait. Generated from source location line 493, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - TAG_
RDebug - Type tag for runtime identification of the
RDebugtrait. Generated from source location line 71, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - TAG_
RDefault - Type tag for runtime identification of the
RDefaulttrait. Generated from source location line 445, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - TAG_
RDisplay - Type tag for runtime identification of the
RDisplaytrait. Generated from source location line 113, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - TAG_
RError - Type tag for runtime identification of the
RErrortrait. Generated from source location line 298, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - TAG_
RExtend - Type tag for runtime identification of the
RExtendtrait. Generated from source location line 778, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - TAG_
RFrom Iter - Type tag for runtime identification of the
RFromItertrait. Generated from source location line 845, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - TAG_
RFrom Str - Type tag for runtime identification of the
RFromStrtrait. Generated from source location line 363, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - TAG_
RHash - Type tag for runtime identification of the
RHashtrait. Generated from source location line 156, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - TAG_
RIterator - Type tag for runtime identification of the
RIteratortrait. Generated from source location line 601, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - TAG_
RMake Iter - Type tag for runtime identification of the
RMakeItertrait. Generated from source location line 1001, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - TAG_
ROrd - Type tag for runtime identification of the
ROrdtrait. Generated from source location line 195, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - TAG_
RPartial Ord - Type tag for runtime identification of the
RPartialOrdtrait. Generated from source location line 237, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - TAG_
RToVec - Type tag for runtime identification of the
RToVectrait. Generated from source location line 915, column 11. Generated from source fileminiextendr-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. - RFrom
Iter - Adapter trait for
std::iter::FromIterator. - RFrom
Str - Adapter trait for
std::str::FromStr. - RHash
- Adapter trait for
std::hash::Hash. - RIterator
- Adapter trait for
std::iter::Iterator. - RMake
Iter - Adapter trait for creating iterator wrappers from collections.
- ROrd
- Adapter trait for
std::cmp::Ord. - RPartial
Ord - 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 404, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - __
RCopy_ build_ vtable - Build a vtable for a concrete type implementing
RCopy. Generated from source location line 493, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - __
RDebug_ build_ vtable - Build a vtable for a concrete type implementing
RDebug. Generated from source location line 71, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - __
RDefault_ build_ vtable - Build a vtable for a concrete type implementing
RDefault. Generated from source location line 445, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - __
RDisplay_ build_ vtable - Build a vtable for a concrete type implementing
RDisplay. Generated from source location line 113, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - __
RError_ build_ vtable - Build a vtable for a concrete type implementing
RError. Generated from source location line 298, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - __
RFrom Str_ build_ vtable - Build a vtable for a concrete type implementing
RFromStr. Generated from source location line 363, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - __
RHash_ build_ vtable - Build a vtable for a concrete type implementing
RHash. Generated from source location line 156, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - __
RIterator_ build_ vtable - Build a vtable for a concrete type implementing
RIterator. Generated from source location line 601, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - __
ROrd_ build_ vtable - Build a vtable for a concrete type implementing
ROrd. Generated from source location line 195, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs. - __
RPartial Ord_ build_ vtable - Build a vtable for a concrete type implementing
RPartialOrd. Generated from source location line 237, column 11. Generated from source fileminiextendr-api/src/adapter_traits.rs.