Skip to main content

AltInteger

Trait AltInteger 

Source
pub trait AltInteger: AltVec {
    const HAS_ELT: bool = false;
    const HAS_GET_REGION: bool = false;
    const HAS_IS_SORTED: bool = false;
    const HAS_NO_NA: bool = false;
    const HAS_SUM: bool = false;
    const HAS_MIN: bool = false;
    const HAS_MAX: bool = false;

    // Provided methods
    fn elt(_x: SEXP, _i: R_xlen_t) -> i32 { ... }
    fn get_region(
        _x: SEXP,
        _i: R_xlen_t,
        _n: R_xlen_t,
        _buf: &mut [i32],
    ) -> R_xlen_t { ... }
    fn is_sorted(_x: SEXP) -> i32 { ... }
    fn no_na(_x: SEXP) -> i32 { ... }
    fn sum(_x: SEXP, _narm: bool) -> SEXP { ... }
    fn min(_x: SEXP, _narm: bool) -> SEXP { ... }
    fn max(_x: SEXP, _narm: bool) -> SEXP { ... }
}
Expand description

Integer vector methods.

For ALTINTEGER, you must provide EITHER:

  • HAS_ELT = true with elt() implementation, OR
  • HAS_DATAPTR = true with dataptr() implementation

If neither is provided, R will error at runtime when accessing elements.

Provided Associated Constants§

Source

const HAS_ELT: bool = false

Set to true to register elt.

Source

const HAS_GET_REGION: bool = false

Set to true to register get_region.

Source

const HAS_IS_SORTED: bool = false

Set to true to register is_sorted.

Source

const HAS_NO_NA: bool = false

Set to true to register no_na.

Source

const HAS_SUM: bool = false

Set to true to register sum.

Source

const HAS_MIN: bool = false

Set to true to register min.

Source

const HAS_MAX: bool = false

Set to true to register max.

Provided Methods§

Source

fn elt(_x: SEXP, _i: R_xlen_t) -> i32

Get element at index.

Source

fn get_region( _x: SEXP, _i: R_xlen_t, _n: R_xlen_t, _buf: &mut [i32], ) -> R_xlen_t

Bulk read elements into buffer.

Source

fn is_sorted(_x: SEXP) -> i32

Sortedness hint.

Source

fn no_na(_x: SEXP) -> i32

NA-free hint.

Source

fn sum(_x: SEXP, _narm: bool) -> SEXP

Optimized sum.

Source

fn min(_x: SEXP, _narm: bool) -> SEXP

Optimized min.

Source

fn max(_x: SEXP, _narm: bool) -> SEXP

Optimized max.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl AltInteger for &'static [i32]

Source§

const HAS_ELT: bool = true

Source§

const HAS_GET_REGION: bool = true

Source§

const HAS_NO_NA: bool = true

Source§

const HAS_SUM: bool = true

Source§

const HAS_MIN: bool = true

Source§

const HAS_MAX: bool = true

Source§

fn elt(x: SEXP, i: R_xlen_t) -> i32

Source§

fn get_region( x: SEXP, start: R_xlen_t, len: R_xlen_t, buf: &mut [i32], ) -> R_xlen_t

Source§

fn no_na(x: SEXP) -> i32

Source§

fn sum(x: SEXP, narm: bool) -> SEXP

Source§

fn min(x: SEXP, narm: bool) -> SEXP

Source§

fn max(x: SEXP, narm: bool) -> SEXP

Source§

impl AltInteger for Box<[i32]>

Source§

const HAS_ELT: bool = true

Source§

const HAS_GET_REGION: bool = true

Source§

const HAS_IS_SORTED: bool = true

Source§

const HAS_NO_NA: bool = true

Source§

const HAS_SUM: bool = true

Source§

const HAS_MIN: bool = true

Source§

const HAS_MAX: bool = true

Source§

fn elt(x: SEXP, i: R_xlen_t) -> i32

Source§

fn get_region( x: SEXP, start: R_xlen_t, len: R_xlen_t, buf: &mut [i32], ) -> R_xlen_t

Source§

fn is_sorted(x: SEXP) -> i32

Source§

fn no_na(x: SEXP) -> i32

Source§

fn sum(x: SEXP, narm: bool) -> SEXP

Source§

fn min(x: SEXP, narm: bool) -> SEXP

Source§

fn max(x: SEXP, narm: bool) -> SEXP

Source§

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

Source§

const HAS_ELT: bool = true

Source§

const HAS_GET_REGION: bool = true

Source§

const HAS_IS_SORTED: bool = true

Source§

const HAS_NO_NA: bool = true

Source§

const HAS_SUM: bool = true

Source§

const HAS_MIN: bool = true

Source§

const HAS_MAX: bool = true

Source§

fn elt(x: SEXP, i: R_xlen_t) -> i32

Source§

fn get_region( x: SEXP, start: R_xlen_t, len: R_xlen_t, buf: &mut [i32], ) -> R_xlen_t

Source§

fn is_sorted(x: SEXP) -> i32

Source§

fn no_na(x: SEXP) -> i32

Source§

fn sum(x: SEXP, narm: bool) -> SEXP

Source§

fn min(x: SEXP, narm: bool) -> SEXP

Source§

fn max(x: SEXP, narm: bool) -> SEXP

Source§

impl AltInteger for Range<i32>

Source§

const HAS_ELT: bool = true

Source§

const HAS_GET_REGION: bool = true

Source§

const HAS_IS_SORTED: bool = true

Source§

const HAS_NO_NA: bool = true

Source§

const HAS_SUM: bool = true

Source§

const HAS_MIN: bool = true

Source§

const HAS_MAX: bool = true

Source§

fn elt(x: SEXP, i: R_xlen_t) -> i32

Source§

fn get_region( x: SEXP, start: R_xlen_t, len: R_xlen_t, buf: &mut [i32], ) -> R_xlen_t

Source§

fn is_sorted(x: SEXP) -> i32

Source§

fn no_na(x: SEXP) -> i32

Source§

fn sum(x: SEXP, narm: bool) -> SEXP

Source§

fn min(x: SEXP, narm: bool) -> SEXP

Source§

fn max(x: SEXP, narm: bool) -> SEXP

Source§

impl AltInteger for Range<i64>

Source§

const HAS_ELT: bool = true

Source§

const HAS_GET_REGION: bool = true

Source§

const HAS_IS_SORTED: bool = true

Source§

const HAS_NO_NA: bool = true

Source§

const HAS_SUM: bool = true

Source§

const HAS_MIN: bool = true

Source§

const HAS_MAX: bool = true

Source§

fn elt(x: SEXP, i: R_xlen_t) -> i32

Source§

fn get_region( x: SEXP, start: R_xlen_t, len: R_xlen_t, buf: &mut [i32], ) -> R_xlen_t

Source§

fn is_sorted(x: SEXP) -> i32

Source§

fn no_na(x: SEXP) -> i32

Source§

fn sum(x: SEXP, narm: bool) -> SEXP

Source§

fn min(x: SEXP, narm: bool) -> SEXP

Source§

fn max(x: SEXP, narm: bool) -> SEXP

Source§

impl AltInteger for Vec<i32>

Source§

const HAS_ELT: bool = true

Source§

const HAS_GET_REGION: bool = true

Source§

const HAS_IS_SORTED: bool = true

Source§

const HAS_NO_NA: bool = true

Source§

const HAS_SUM: bool = true

Source§

const HAS_MIN: bool = true

Source§

const HAS_MAX: bool = true

Source§

fn elt(x: SEXP, i: R_xlen_t) -> i32

Source§

fn get_region( x: SEXP, start: R_xlen_t, len: R_xlen_t, buf: &mut [i32], ) -> R_xlen_t

Source§

fn is_sorted(x: SEXP) -> i32

Source§

fn no_na(x: SEXP) -> i32

Source§

fn sum(x: SEXP, narm: bool) -> SEXP

Source§

fn min(x: SEXP, narm: bool) -> SEXP

Source§

fn max(x: SEXP, narm: bool) -> SEXP

Source§

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

Source§

const HAS_ELT: bool = true

Source§

const HAS_GET_REGION: bool = true

Source§

const HAS_NO_NA: bool = true

Source§

fn elt(x: SEXP, i: R_xlen_t) -> i32

Source§

fn get_region( x: SEXP, start: R_xlen_t, len: R_xlen_t, buf: &mut [i32], ) -> R_xlen_t

Source§

fn no_na(x: SEXP) -> i32

Implementors§