polars_compute::if_then_else

Trait IfThenElseKernel

Source
pub trait IfThenElseKernel: Sized + Array {
    type Scalar<'a>;

    // Required methods
    fn if_then_else(mask: &Bitmap, if_true: &Self, if_false: &Self) -> Self;
    fn if_then_else_broadcast_true(
        mask: &Bitmap,
        if_true: Self::Scalar<'_>,
        if_false: &Self,
    ) -> Self;
    fn if_then_else_broadcast_false(
        mask: &Bitmap,
        if_true: &Self,
        if_false: Self::Scalar<'_>,
    ) -> Self;
    fn if_then_else_broadcast_both(
        dtype: ArrowDataType,
        mask: &Bitmap,
        if_true: Self::Scalar<'_>,
        if_false: Self::Scalar<'_>,
    ) -> Self;
}

Required Associated Types§

Source

type Scalar<'a>

Required Methods§

Source

fn if_then_else(mask: &Bitmap, if_true: &Self, if_false: &Self) -> Self

Source

fn if_then_else_broadcast_true( mask: &Bitmap, if_true: Self::Scalar<'_>, if_false: &Self, ) -> Self

Source

fn if_then_else_broadcast_false( mask: &Bitmap, if_true: &Self, if_false: Self::Scalar<'_>, ) -> Self

Source

fn if_then_else_broadcast_both( dtype: ArrowDataType, mask: &Bitmap, if_true: Self::Scalar<'_>, if_false: Self::Scalar<'_>, ) -> Self

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 IfThenElseKernel for BooleanArray

Source§

type Scalar<'a> = bool

Source§

fn if_then_else(mask: &Bitmap, if_true: &Self, if_false: &Self) -> Self

Source§

fn if_then_else_broadcast_true( mask: &Bitmap, if_true: Self::Scalar<'_>, if_false: &Self, ) -> Self

Source§

fn if_then_else_broadcast_false( mask: &Bitmap, if_true: &Self, if_false: Self::Scalar<'_>, ) -> Self

Source§

fn if_then_else_broadcast_both( _dtype: ArrowDataType, mask: &Bitmap, if_true: Self::Scalar<'_>, if_false: Self::Scalar<'_>, ) -> Self

Source§

impl IfThenElseKernel for FixedSizeListArray

Source§

type Scalar<'a> = Box<dyn Array>

Source§

fn if_then_else(mask: &Bitmap, if_true: &Self, if_false: &Self) -> Self

Source§

fn if_then_else_broadcast_true( mask: &Bitmap, if_true: Self::Scalar<'_>, if_false: &Self, ) -> Self

Source§

fn if_then_else_broadcast_false( mask: &Bitmap, if_true: &Self, if_false: Self::Scalar<'_>, ) -> Self

Source§

fn if_then_else_broadcast_both( dtype: ArrowDataType, mask: &Bitmap, if_true: Self::Scalar<'_>, if_false: Self::Scalar<'_>, ) -> Self

Source§

impl IfThenElseKernel for ListArray<i64>

Source§

type Scalar<'a> = Box<dyn Array>

Source§

fn if_then_else(mask: &Bitmap, if_true: &Self, if_false: &Self) -> Self

Source§

fn if_then_else_broadcast_true( mask: &Bitmap, if_true: Self::Scalar<'_>, if_false: &Self, ) -> Self

Source§

fn if_then_else_broadcast_false( mask: &Bitmap, if_true: &Self, if_false: Self::Scalar<'_>, ) -> Self

Source§

fn if_then_else_broadcast_both( dtype: ArrowDataType, mask: &Bitmap, if_true: Self::Scalar<'_>, if_false: Self::Scalar<'_>, ) -> Self

Source§

impl IfThenElseKernel for BinaryViewArray

Source§

type Scalar<'a> = &'a [u8]

Source§

fn if_then_else(mask: &Bitmap, if_true: &Self, if_false: &Self) -> Self

Source§

fn if_then_else_broadcast_true( mask: &Bitmap, if_true: Self::Scalar<'_>, if_false: &Self, ) -> Self

Source§

fn if_then_else_broadcast_false( mask: &Bitmap, if_true: &Self, if_false: Self::Scalar<'_>, ) -> Self

Source§

fn if_then_else_broadcast_both( dtype: ArrowDataType, mask: &Bitmap, if_true: Self::Scalar<'_>, if_false: Self::Scalar<'_>, ) -> Self

Source§

impl IfThenElseKernel for Utf8ViewArray

Source§

type Scalar<'a> = &'a str

Source§

fn if_then_else(mask: &Bitmap, if_true: &Self, if_false: &Self) -> Self

Source§

fn if_then_else_broadcast_true( mask: &Bitmap, if_true: Self::Scalar<'_>, if_false: &Self, ) -> Self

Source§

fn if_then_else_broadcast_false( mask: &Bitmap, if_true: &Self, if_false: Self::Scalar<'_>, ) -> Self

Source§

fn if_then_else_broadcast_both( dtype: ArrowDataType, mask: &Bitmap, if_true: Self::Scalar<'_>, if_false: Self::Scalar<'_>, ) -> Self

Source§

impl<T: NotSimdPrimitive> IfThenElseKernel for PrimitiveArray<T>

Source§

type Scalar<'a> = T

Source§

fn if_then_else(mask: &Bitmap, if_true: &Self, if_false: &Self) -> Self

Source§

fn if_then_else_broadcast_true( mask: &Bitmap, if_true: Self::Scalar<'_>, if_false: &Self, ) -> Self

Source§

fn if_then_else_broadcast_false( mask: &Bitmap, if_true: &Self, if_false: Self::Scalar<'_>, ) -> Self

Source§

fn if_then_else_broadcast_both( _dtype: ArrowDataType, mask: &Bitmap, if_true: Self::Scalar<'_>, if_false: Self::Scalar<'_>, ) -> Self

Implementors§