Skip to main content

InferBase

Trait InferBase 

Source
pub trait InferBase {
    const BASE: RBase;

    // Required methods
    unsafe fn make_class(
        class_name: *const i8,
        pkg_name: *const i8,
    ) -> R_altrep_class_t;
    unsafe fn install_methods(cls: R_altrep_class_t);
}
Expand description

Trait for inferring the R base type from a data type’s implemented traits.

This is automatically implemented via blanket impls for types that implement one of the Alt*Data traits. It allows the #[miniextendr] macro to infer the base type without requiring an explicit base = \"...\" attribute.

Required Associated Constants§

Source

const BASE: RBase

The inferred R base type.

Required Methods§

Source

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Create the ALTREP class handle.

§Safety

Must be called during R initialization.

Source

unsafe fn install_methods(cls: R_altrep_class_t)

Install ALTREP methods on the class.

§Safety

Must be called during R initialization with a valid class handle.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl InferBase for &'static [&'static str]

Source§

const BASE: RBase = crate::altrep::RBase::String

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl InferBase for &'static [bool]

Source§

const BASE: RBase = crate::altrep::RBase::Logical

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl InferBase for &'static [f64]

Source§

const BASE: RBase = crate::altrep::RBase::Real

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl InferBase for &'static [i32]

Source§

const BASE: RBase = crate::altrep::RBase::Int

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl InferBase for &'static [u8]

Source§

const BASE: RBase = crate::altrep::RBase::Raw

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl InferBase for &'static [String]

Source§

const BASE: RBase = crate::altrep::RBase::String

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl InferBase for Cow<'static, [f64]>

Source§

const BASE: RBase = crate::altrep::RBase::Real

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl InferBase for Cow<'static, [i32]>

Source§

const BASE: RBase = crate::altrep::RBase::Int

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl InferBase for Cow<'static, [u8]>

Source§

const BASE: RBase = crate::altrep::RBase::Raw

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl InferBase for Cow<'static, [Rcomplex]>

Source§

const BASE: RBase = crate::altrep::RBase::Complex

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl InferBase for Box<[bool]>

Source§

const BASE: RBase = crate::altrep::RBase::Logical

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl InferBase for Box<[f64]>

Source§

const BASE: RBase = crate::altrep::RBase::Real

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl InferBase for Box<[i32]>

Source§

const BASE: RBase = crate::altrep::RBase::Int

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl InferBase for Box<[u8]>

Source§

const BASE: RBase = crate::altrep::RBase::Raw

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl InferBase for Box<[Rcomplex]>

Source§

const BASE: RBase = crate::altrep::RBase::Complex

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl InferBase for Box<[String]>

Source§

const BASE: RBase = crate::altrep::RBase::String

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl InferBase for Vec<Cow<'static, str>>

Source§

const BASE: RBase = crate::altrep::RBase::String

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl InferBase for Vec<Option<Cow<'static, str>>>

Source§

const BASE: RBase = crate::altrep::RBase::String

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl InferBase for Vec<Option<String>>

Source§

const BASE: RBase = crate::altrep::RBase::String

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl InferBase for Vec<bool>

Source§

const BASE: RBase = crate::altrep::RBase::Logical

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl InferBase for Vec<f64>

Source§

const BASE: RBase = crate::altrep::RBase::Real

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl InferBase for Vec<i32>

Source§

const BASE: RBase = crate::altrep::RBase::Int

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl InferBase for Vec<u8>

Source§

const BASE: RBase = crate::altrep::RBase::Raw

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl InferBase for Vec<Rcomplex>

Source§

const BASE: RBase = crate::altrep::RBase::Complex

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl InferBase for Vec<String>

Source§

const BASE: RBase = crate::altrep::RBase::String

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl InferBase for Range<f64>

Source§

const BASE: RBase = crate::altrep::RBase::Real

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl InferBase for Range<i32>

Source§

const BASE: RBase = crate::altrep::RBase::Int

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl InferBase for Range<i64>

Source§

const BASE: RBase = crate::altrep::RBase::Int

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl<const N: usize> InferBase for [bool; N]

Source§

const BASE: RBase = crate::altrep::RBase::Logical

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl<const N: usize> InferBase for [f64; N]

Source§

const BASE: RBase = crate::altrep::RBase::Real

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl<const N: usize> InferBase for [i32; N]

Source§

const BASE: RBase = crate::altrep::RBase::Int

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl<const N: usize> InferBase for [u8; N]

Source§

const BASE: RBase = crate::altrep::RBase::Raw

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl<const N: usize> InferBase for [Rcomplex; N]

Source§

const BASE: RBase = crate::altrep::RBase::Complex

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Source§

impl<const N: usize> InferBase for [String; N]

Source§

const BASE: RBase = crate::altrep::RBase::String

Source§

unsafe fn make_class( class_name: *const i8, pkg_name: *const i8, ) -> R_altrep_class_t

Source§

unsafe fn install_methods(cls: R_altrep_class_t)

Implementors§

Source§

impl<F: Fn(usize, &mut [f64]) -> usize + 'static> InferBase for StreamingRealData<F>

Source§

const BASE: RBase = crate::altrep::RBase::Real

Source§

impl<F: Fn(usize, &mut [i32]) -> usize + 'static> InferBase for StreamingIntData<F>

Source§

const BASE: RBase = crate::altrep::RBase::Int

Source§

impl<I, T> InferBase for IterIntCoerceData<I, T>
where I: Iterator<Item = T> + 'static, T: Coerce<i32> + Copy + 'static,

Source§

const BASE: RBase = crate::altrep::RBase::Int

Source§

impl<I, T> InferBase for IterRealCoerceData<I, T>
where I: Iterator<Item = T> + 'static, T: Coerce<f64> + Copy + 'static,

Source§

const BASE: RBase = crate::altrep::RBase::Real

Source§

impl<I: Iterator<Item = bool> + 'static> InferBase for IterIntFromBoolData<I>

Source§

const BASE: RBase = crate::altrep::RBase::Int

Source§

impl<I: Iterator<Item = bool> + 'static> InferBase for IterLogicalData<I>

Source§

const BASE: RBase = crate::altrep::RBase::Logical

Source§

impl<I: Iterator<Item = bool> + 'static> InferBase for SparseIterLogicalData<I>

Source§

const BASE: RBase = crate::altrep::RBase::Logical

Source§

impl<I: Iterator<Item = f64> + 'static> InferBase for IterRealData<I>

Source§

const BASE: RBase = crate::altrep::RBase::Real

Source§

impl<I: Iterator<Item = f64> + 'static> InferBase for SparseIterRealData<I>

Source§

const BASE: RBase = crate::altrep::RBase::Real

Source§

impl<I: Iterator<Item = f64> + 'static> InferBase for WindowedIterRealData<I>

Source§

const BASE: RBase = crate::altrep::RBase::Real

Source§

impl<I: Iterator<Item = i32> + 'static> InferBase for IterIntData<I>

Source§

const BASE: RBase = crate::altrep::RBase::Int

Source§

impl<I: Iterator<Item = i32> + 'static> InferBase for SparseIterIntData<I>

Source§

const BASE: RBase = crate::altrep::RBase::Int

Source§

impl<I: Iterator<Item = i32> + 'static> InferBase for WindowedIterIntData<I>

Source§

const BASE: RBase = crate::altrep::RBase::Int

Source§

impl<I: Iterator<Item = u8> + 'static> InferBase for IterRawData<I>

Source§

const BASE: RBase = crate::altrep::RBase::Raw

Source§

impl<I: Iterator<Item = u8> + 'static> InferBase for SparseIterRawData<I>

Source§

const BASE: RBase = crate::altrep::RBase::Raw

Source§

impl<I: Iterator<Item = Rcomplex> + 'static> InferBase for IterComplexData<I>

Source§

const BASE: RBase = crate::altrep::RBase::Complex

Source§

impl<I: Iterator<Item = Rcomplex> + 'static> InferBase for SparseIterComplexData<I>

Source§

const BASE: RBase = crate::altrep::RBase::Complex

Source§

impl<I: Iterator<Item = SEXP> + 'static> InferBase for IterListData<I>

Source§

const BASE: RBase = crate::altrep::RBase::List

Source§

impl<I: Iterator<Item = String> + 'static> InferBase for IterStringData<I>

Source§

const BASE: RBase = crate::altrep::RBase::String