Trait arrow_array::ArrowNativeTypeOp

source ·
pub trait ArrowNativeTypeOp: ArrowNativeType {
    const ZERO: Self;
    const ONE: Self;
    const MIN_TOTAL_ORDER: Self;
    const MAX_TOTAL_ORDER: Self;
Show 22 methods // Required methods fn add_checked(self, rhs: Self) -> Result<Self, ArrowError>; fn add_wrapping(self, rhs: Self) -> Self; fn sub_checked(self, rhs: Self) -> Result<Self, ArrowError>; fn sub_wrapping(self, rhs: Self) -> Self; fn mul_checked(self, rhs: Self) -> Result<Self, ArrowError>; fn mul_wrapping(self, rhs: Self) -> Self; fn div_checked(self, rhs: Self) -> Result<Self, ArrowError>; fn div_wrapping(self, rhs: Self) -> Self; fn mod_checked(self, rhs: Self) -> Result<Self, ArrowError>; fn mod_wrapping(self, rhs: Self) -> Self; fn neg_checked(self) -> Result<Self, ArrowError>; fn neg_wrapping(self) -> Self; fn pow_checked(self, exp: u32) -> Result<Self, ArrowError>; fn pow_wrapping(self, exp: u32) -> Self; fn is_zero(self) -> bool; fn compare(self, rhs: Self) -> Ordering; fn is_eq(self, rhs: Self) -> bool; // Provided methods fn is_ne(self, rhs: Self) -> bool { ... } fn is_lt(self, rhs: Self) -> bool { ... } fn is_le(self, rhs: Self) -> bool { ... } fn is_gt(self, rhs: Self) -> bool { ... } fn is_ge(self, rhs: Self) -> bool { ... }
}
Expand description

Trait for ArrowNativeType that adds checked and unchecked arithmetic operations, and totally ordered comparison operations

The APIs with _wrapping suffix do not perform overflow-checking. For integer types they will wrap around the boundary of the type. For floating point types they will overflow to INF or -INF preserving the expected sign value

Note div_wrapping and mod_wrapping will panic for integer types if rhs is zero although this may be subject to change https://github.com/apache/arrow-rs/issues/2647

The APIs with _checked suffix perform overflow-checking. For integer types these will return Err instead of wrapping. For floating point types they will overflow to INF or -INF preserving the expected sign value

Comparison of integer types is as per normal integer comparison rules, floating point values are compared as per IEEE 754’s totalOrder predicate see f32::total_cmp

Required Associated Constants§

source

const ZERO: Self

The additive identity

source

const ONE: Self

The multiplicative identity

source

const MIN_TOTAL_ORDER: Self

The minimum value and identity for the max aggregation. Note that the aggregation uses the total order predicate for floating point values, which means that this value is a negative NaN.

source

const MAX_TOTAL_ORDER: Self

The maximum value and identity for the min aggregation. Note that the aggregation uses the total order predicate for floating point values, which means that this value is a positive NaN.

Required Methods§

source

fn add_checked(self, rhs: Self) -> Result<Self, ArrowError>

Checked addition operation

source

fn add_wrapping(self, rhs: Self) -> Self

Wrapping addition operation

source

fn sub_checked(self, rhs: Self) -> Result<Self, ArrowError>

Checked subtraction operation

source

fn sub_wrapping(self, rhs: Self) -> Self

Wrapping subtraction operation

source

fn mul_checked(self, rhs: Self) -> Result<Self, ArrowError>

Checked multiplication operation

source

fn mul_wrapping(self, rhs: Self) -> Self

Wrapping multiplication operation

source

fn div_checked(self, rhs: Self) -> Result<Self, ArrowError>

Checked division operation

source

fn div_wrapping(self, rhs: Self) -> Self

Wrapping division operation

source

fn mod_checked(self, rhs: Self) -> Result<Self, ArrowError>

Checked remainder operation

source

fn mod_wrapping(self, rhs: Self) -> Self

Wrapping remainder operation

source

fn neg_checked(self) -> Result<Self, ArrowError>

Checked negation operation

source

fn neg_wrapping(self) -> Self

Wrapping negation operation

source

fn pow_checked(self, exp: u32) -> Result<Self, ArrowError>

Checked exponentiation operation

source

fn pow_wrapping(self, exp: u32) -> Self

Wrapping exponentiation operation

source

fn is_zero(self) -> bool

Returns true if zero else false

source

fn compare(self, rhs: Self) -> Ordering

Compare operation

source

fn is_eq(self, rhs: Self) -> bool

Equality operation

Provided Methods§

source

fn is_ne(self, rhs: Self) -> bool

Not equal operation

source

fn is_lt(self, rhs: Self) -> bool

Less than operation

source

fn is_le(self, rhs: Self) -> bool

Less than equals operation

source

fn is_gt(self, rhs: Self) -> bool

Greater than operation

source

fn is_ge(self, rhs: Self) -> bool

Greater than equals operation

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl ArrowNativeTypeOp for f32

source§

const ZERO: Self = 0f32

source§

const ONE: Self = 1f32

source§

const MIN_TOTAL_ORDER: Self = NaN_f32

source§

const MAX_TOTAL_ORDER: Self = NaN_f32

source§

fn add_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn add_wrapping(self, rhs: Self) -> Self

source§

fn sub_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn sub_wrapping(self, rhs: Self) -> Self

source§

fn mul_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn mul_wrapping(self, rhs: Self) -> Self

source§

fn div_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn div_wrapping(self, rhs: Self) -> Self

source§

fn mod_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn mod_wrapping(self, rhs: Self) -> Self

source§

fn neg_checked(self) -> Result<Self, ArrowError>

source§

fn neg_wrapping(self) -> Self

source§

fn pow_checked(self, exp: u32) -> Result<Self, ArrowError>

source§

fn pow_wrapping(self, exp: u32) -> Self

source§

fn is_zero(self) -> bool

source§

fn compare(self, rhs: Self) -> Ordering

source§

fn is_eq(self, rhs: Self) -> bool

source§

impl ArrowNativeTypeOp for f64

source§

const ZERO: Self = 0f64

source§

const ONE: Self = 1f64

source§

const MIN_TOTAL_ORDER: Self = NaN_f64

source§

const MAX_TOTAL_ORDER: Self = NaN_f64

source§

fn add_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn add_wrapping(self, rhs: Self) -> Self

source§

fn sub_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn sub_wrapping(self, rhs: Self) -> Self

source§

fn mul_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn mul_wrapping(self, rhs: Self) -> Self

source§

fn div_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn div_wrapping(self, rhs: Self) -> Self

source§

fn mod_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn mod_wrapping(self, rhs: Self) -> Self

source§

fn neg_checked(self) -> Result<Self, ArrowError>

source§

fn neg_wrapping(self) -> Self

source§

fn pow_checked(self, exp: u32) -> Result<Self, ArrowError>

source§

fn pow_wrapping(self, exp: u32) -> Self

source§

fn is_zero(self) -> bool

source§

fn compare(self, rhs: Self) -> Ordering

source§

fn is_eq(self, rhs: Self) -> bool

source§

impl ArrowNativeTypeOp for i8

source§

const ZERO: Self = 0i8

source§

const ONE: Self = 1i8

source§

const MIN_TOTAL_ORDER: Self = -128i8

source§

const MAX_TOTAL_ORDER: Self = 127i8

source§

fn add_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn add_wrapping(self, rhs: Self) -> Self

source§

fn sub_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn sub_wrapping(self, rhs: Self) -> Self

source§

fn mul_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn mul_wrapping(self, rhs: Self) -> Self

source§

fn div_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn div_wrapping(self, rhs: Self) -> Self

source§

fn mod_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn mod_wrapping(self, rhs: Self) -> Self

source§

fn neg_checked(self) -> Result<Self, ArrowError>

source§

fn pow_checked(self, exp: u32) -> Result<Self, ArrowError>

source§

fn pow_wrapping(self, exp: u32) -> Self

source§

fn neg_wrapping(self) -> Self

source§

fn is_zero(self) -> bool

source§

fn compare(self, rhs: Self) -> Ordering

source§

fn is_eq(self, rhs: Self) -> bool

source§

impl ArrowNativeTypeOp for i16

source§

const ZERO: Self = 0i16

source§

const ONE: Self = 1i16

source§

const MIN_TOTAL_ORDER: Self = -32_768i16

source§

const MAX_TOTAL_ORDER: Self = 32_767i16

source§

fn add_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn add_wrapping(self, rhs: Self) -> Self

source§

fn sub_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn sub_wrapping(self, rhs: Self) -> Self

source§

fn mul_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn mul_wrapping(self, rhs: Self) -> Self

source§

fn div_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn div_wrapping(self, rhs: Self) -> Self

source§

fn mod_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn mod_wrapping(self, rhs: Self) -> Self

source§

fn neg_checked(self) -> Result<Self, ArrowError>

source§

fn pow_checked(self, exp: u32) -> Result<Self, ArrowError>

source§

fn pow_wrapping(self, exp: u32) -> Self

source§

fn neg_wrapping(self) -> Self

source§

fn is_zero(self) -> bool

source§

fn compare(self, rhs: Self) -> Ordering

source§

fn is_eq(self, rhs: Self) -> bool

source§

impl ArrowNativeTypeOp for i32

source§

const ZERO: Self = 0i32

source§

const ONE: Self = 1i32

source§

const MIN_TOTAL_ORDER: Self = -2_147_483_648i32

source§

const MAX_TOTAL_ORDER: Self = 2_147_483_647i32

source§

fn add_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn add_wrapping(self, rhs: Self) -> Self

source§

fn sub_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn sub_wrapping(self, rhs: Self) -> Self

source§

fn mul_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn mul_wrapping(self, rhs: Self) -> Self

source§

fn div_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn div_wrapping(self, rhs: Self) -> Self

source§

fn mod_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn mod_wrapping(self, rhs: Self) -> Self

source§

fn neg_checked(self) -> Result<Self, ArrowError>

source§

fn pow_checked(self, exp: u32) -> Result<Self, ArrowError>

source§

fn pow_wrapping(self, exp: u32) -> Self

source§

fn neg_wrapping(self) -> Self

source§

fn is_zero(self) -> bool

source§

fn compare(self, rhs: Self) -> Ordering

source§

fn is_eq(self, rhs: Self) -> bool

source§

impl ArrowNativeTypeOp for i64

source§

const ZERO: Self = 0i64

source§

const ONE: Self = 1i64

source§

const MIN_TOTAL_ORDER: Self = -9_223_372_036_854_775_808i64

source§

const MAX_TOTAL_ORDER: Self = 9_223_372_036_854_775_807i64

source§

fn add_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn add_wrapping(self, rhs: Self) -> Self

source§

fn sub_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn sub_wrapping(self, rhs: Self) -> Self

source§

fn mul_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn mul_wrapping(self, rhs: Self) -> Self

source§

fn div_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn div_wrapping(self, rhs: Self) -> Self

source§

fn mod_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn mod_wrapping(self, rhs: Self) -> Self

source§

fn neg_checked(self) -> Result<Self, ArrowError>

source§

fn pow_checked(self, exp: u32) -> Result<Self, ArrowError>

source§

fn pow_wrapping(self, exp: u32) -> Self

source§

fn neg_wrapping(self) -> Self

source§

fn is_zero(self) -> bool

source§

fn compare(self, rhs: Self) -> Ordering

source§

fn is_eq(self, rhs: Self) -> bool

source§

impl ArrowNativeTypeOp for i128

source§

const ZERO: Self = 0i128

source§

const ONE: Self = 1i128

source§

const MIN_TOTAL_ORDER: Self = -170_141_183_460_469_231_731_687_303_715_884_105_728i128

source§

const MAX_TOTAL_ORDER: Self = 170_141_183_460_469_231_731_687_303_715_884_105_727i128

source§

fn add_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn add_wrapping(self, rhs: Self) -> Self

source§

fn sub_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn sub_wrapping(self, rhs: Self) -> Self

source§

fn mul_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn mul_wrapping(self, rhs: Self) -> Self

source§

fn div_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn div_wrapping(self, rhs: Self) -> Self

source§

fn mod_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn mod_wrapping(self, rhs: Self) -> Self

source§

fn neg_checked(self) -> Result<Self, ArrowError>

source§

fn pow_checked(self, exp: u32) -> Result<Self, ArrowError>

source§

fn pow_wrapping(self, exp: u32) -> Self

source§

fn neg_wrapping(self) -> Self

source§

fn is_zero(self) -> bool

source§

fn compare(self, rhs: Self) -> Ordering

source§

fn is_eq(self, rhs: Self) -> bool

source§

impl ArrowNativeTypeOp for u8

source§

const ZERO: Self = 0u8

source§

const ONE: Self = 1u8

source§

const MIN_TOTAL_ORDER: Self = 0u8

source§

const MAX_TOTAL_ORDER: Self = 255u8

source§

fn add_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn add_wrapping(self, rhs: Self) -> Self

source§

fn sub_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn sub_wrapping(self, rhs: Self) -> Self

source§

fn mul_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn mul_wrapping(self, rhs: Self) -> Self

source§

fn div_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn div_wrapping(self, rhs: Self) -> Self

source§

fn mod_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn mod_wrapping(self, rhs: Self) -> Self

source§

fn neg_checked(self) -> Result<Self, ArrowError>

source§

fn pow_checked(self, exp: u32) -> Result<Self, ArrowError>

source§

fn pow_wrapping(self, exp: u32) -> Self

source§

fn neg_wrapping(self) -> Self

source§

fn is_zero(self) -> bool

source§

fn compare(self, rhs: Self) -> Ordering

source§

fn is_eq(self, rhs: Self) -> bool

source§

impl ArrowNativeTypeOp for u16

source§

const ZERO: Self = 0u16

source§

const ONE: Self = 1u16

source§

const MIN_TOTAL_ORDER: Self = 0u16

source§

const MAX_TOTAL_ORDER: Self = 65_535u16

source§

fn add_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn add_wrapping(self, rhs: Self) -> Self

source§

fn sub_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn sub_wrapping(self, rhs: Self) -> Self

source§

fn mul_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn mul_wrapping(self, rhs: Self) -> Self

source§

fn div_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn div_wrapping(self, rhs: Self) -> Self

source§

fn mod_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn mod_wrapping(self, rhs: Self) -> Self

source§

fn neg_checked(self) -> Result<Self, ArrowError>

source§

fn pow_checked(self, exp: u32) -> Result<Self, ArrowError>

source§

fn pow_wrapping(self, exp: u32) -> Self

source§

fn neg_wrapping(self) -> Self

source§

fn is_zero(self) -> bool

source§

fn compare(self, rhs: Self) -> Ordering

source§

fn is_eq(self, rhs: Self) -> bool

source§

impl ArrowNativeTypeOp for u32

source§

const ZERO: Self = 0u32

source§

const ONE: Self = 1u32

source§

const MIN_TOTAL_ORDER: Self = 0u32

source§

const MAX_TOTAL_ORDER: Self = 4_294_967_295u32

source§

fn add_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn add_wrapping(self, rhs: Self) -> Self

source§

fn sub_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn sub_wrapping(self, rhs: Self) -> Self

source§

fn mul_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn mul_wrapping(self, rhs: Self) -> Self

source§

fn div_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn div_wrapping(self, rhs: Self) -> Self

source§

fn mod_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn mod_wrapping(self, rhs: Self) -> Self

source§

fn neg_checked(self) -> Result<Self, ArrowError>

source§

fn pow_checked(self, exp: u32) -> Result<Self, ArrowError>

source§

fn pow_wrapping(self, exp: u32) -> Self

source§

fn neg_wrapping(self) -> Self

source§

fn is_zero(self) -> bool

source§

fn compare(self, rhs: Self) -> Ordering

source§

fn is_eq(self, rhs: Self) -> bool

source§

impl ArrowNativeTypeOp for u64

source§

const ZERO: Self = 0u64

source§

const ONE: Self = 1u64

source§

const MIN_TOTAL_ORDER: Self = 0u64

source§

const MAX_TOTAL_ORDER: Self = 18_446_744_073_709_551_615u64

source§

fn add_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn add_wrapping(self, rhs: Self) -> Self

source§

fn sub_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn sub_wrapping(self, rhs: Self) -> Self

source§

fn mul_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn mul_wrapping(self, rhs: Self) -> Self

source§

fn div_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn div_wrapping(self, rhs: Self) -> Self

source§

fn mod_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn mod_wrapping(self, rhs: Self) -> Self

source§

fn neg_checked(self) -> Result<Self, ArrowError>

source§

fn pow_checked(self, exp: u32) -> Result<Self, ArrowError>

source§

fn pow_wrapping(self, exp: u32) -> Self

source§

fn neg_wrapping(self) -> Self

source§

fn is_zero(self) -> bool

source§

fn compare(self, rhs: Self) -> Ordering

source§

fn is_eq(self, rhs: Self) -> bool

source§

impl ArrowNativeTypeOp for i256

source§

const ZERO: Self = i256::ZERO

source§

const ONE: Self = i256::ONE

source§

const MIN_TOTAL_ORDER: Self = i256::MIN

source§

const MAX_TOTAL_ORDER: Self = i256::MAX

source§

fn add_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn add_wrapping(self, rhs: Self) -> Self

source§

fn sub_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn sub_wrapping(self, rhs: Self) -> Self

source§

fn mul_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn mul_wrapping(self, rhs: Self) -> Self

source§

fn div_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn div_wrapping(self, rhs: Self) -> Self

source§

fn mod_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn mod_wrapping(self, rhs: Self) -> Self

source§

fn neg_checked(self) -> Result<Self, ArrowError>

source§

fn pow_checked(self, exp: u32) -> Result<Self, ArrowError>

source§

fn pow_wrapping(self, exp: u32) -> Self

source§

fn neg_wrapping(self) -> Self

source§

fn is_zero(self) -> bool

source§

fn compare(self, rhs: Self) -> Ordering

source§

fn is_eq(self, rhs: Self) -> bool

source§

impl ArrowNativeTypeOp for f16

source§

const ZERO: Self = f16::ZERO

source§

const ONE: Self = f16::ONE

source§

const MIN_TOTAL_ORDER: Self = _

source§

const MAX_TOTAL_ORDER: Self = _

source§

fn add_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn add_wrapping(self, rhs: Self) -> Self

source§

fn sub_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn sub_wrapping(self, rhs: Self) -> Self

source§

fn mul_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn mul_wrapping(self, rhs: Self) -> Self

source§

fn div_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn div_wrapping(self, rhs: Self) -> Self

source§

fn mod_checked(self, rhs: Self) -> Result<Self, ArrowError>

source§

fn mod_wrapping(self, rhs: Self) -> Self

source§

fn neg_checked(self) -> Result<Self, ArrowError>

source§

fn neg_wrapping(self) -> Self

source§

fn pow_checked(self, exp: u32) -> Result<Self, ArrowError>

source§

fn pow_wrapping(self, exp: u32) -> Self

source§

fn is_zero(self) -> bool

source§

fn compare(self, rhs: Self) -> Ordering

source§

fn is_eq(self, rhs: Self) -> bool

Implementors§

source§

impl ArrowNativeTypeOp for IntervalDayTime

source§

const ZERO: Self = IntervalDayTime::ZERO

source§

const ONE: Self = IntervalDayTime::ONE

source§

const MIN_TOTAL_ORDER: Self = IntervalDayTime::MIN

source§

const MAX_TOTAL_ORDER: Self = IntervalDayTime::MAX

source§

impl ArrowNativeTypeOp for IntervalMonthDayNano

source§

const ZERO: Self = IntervalMonthDayNano::ZERO

source§

const ONE: Self = IntervalMonthDayNano::ONE

source§

const MIN_TOTAL_ORDER: Self = IntervalMonthDayNano::MIN

source§

const MAX_TOTAL_ORDER: Self = IntervalMonthDayNano::MAX