polars_arrow::types

Trait Index

Source
pub trait Index:
    NativeType
    + AddAssign
    + Sub<Output = Self>
    + One
    + Num
    + CheckedAdd
    + PartialOrd
    + Ord {
    // Required methods
    fn to_usize(&self) -> usize;
    fn from_usize(index: usize) -> Option<Self>;
    fn from_as_usize(index: usize) -> Self;

    // Provided method
    fn range(start: usize, end: usize) -> Option<IndexRange<Self>> { ... }
}
Expand description

Sealed trait describing the subset of NativeType (i32, i64, u32 and u64) that can be used to index a slot of an array.

Required Methods§

Source

fn to_usize(&self) -> usize

Convert itself to usize.

Source

fn from_usize(index: usize) -> Option<Self>

Convert itself from usize.

Source

fn from_as_usize(index: usize) -> Self

Convert itself from usize.

Provided Methods§

Source

fn range(start: usize, end: usize) -> Option<IndexRange<Self>>

An iterator from (inclusive) start to (exclusive) end.

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 Index for i8

Source§

fn to_usize(&self) -> usize

Source§

fn from_usize(value: usize) -> Option<Self>

Source§

fn from_as_usize(value: usize) -> Self

Source§

impl Index for i16

Source§

fn to_usize(&self) -> usize

Source§

fn from_usize(value: usize) -> Option<Self>

Source§

fn from_as_usize(value: usize) -> Self

Source§

impl Index for i32

Source§

fn to_usize(&self) -> usize

Source§

fn from_usize(value: usize) -> Option<Self>

Source§

fn from_as_usize(value: usize) -> Self

Source§

impl Index for i64

Source§

fn to_usize(&self) -> usize

Source§

fn from_usize(value: usize) -> Option<Self>

Source§

fn from_as_usize(value: usize) -> Self

Source§

impl Index for u8

Source§

fn to_usize(&self) -> usize

Source§

fn from_usize(value: usize) -> Option<Self>

Source§

fn from_as_usize(value: usize) -> Self

Source§

impl Index for u16

Source§

fn to_usize(&self) -> usize

Source§

fn from_usize(value: usize) -> Option<Self>

Source§

fn from_as_usize(value: usize) -> Self

Source§

impl Index for u32

Source§

fn to_usize(&self) -> usize

Source§

fn from_usize(value: usize) -> Option<Self>

Source§

fn from_as_usize(value: usize) -> Self

Source§

impl Index for u64

Source§

fn to_usize(&self) -> usize

Source§

fn from_usize(value: usize) -> Option<Self>

Source§

fn from_as_usize(value: usize) -> Self

Implementors§