Skip to main content

Element

Trait Element 

Source
pub trait Element:
    Clone
    + Debug
    + Display
    + Send
    + Sync
    + PartialEq
    + 'static
    + Sealed {
    // Required methods
    fn dtype() -> DType;
    fn zero() -> Self;
    fn one() -> Self;
}
Expand description

Trait bound for types that can be stored in a ferray array.

This is implemented for all supported numeric types plus bool. The trait is sealed: downstream crates cannot implement it for new types (use DynArray or FerrayRecord for custom element types).

Required Methods§

Source

fn dtype() -> DType

The runtime DType tag for this element type.

Source

fn zero() -> Self

The zero/additive-identity value.

Source

fn one() -> Self

The one/multiplicative-identity value.

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 Element for bool

Source§

impl Element for f32

Source§

impl Element for f64

Source§

impl Element for i8

Source§

impl Element for i16

Source§

impl Element for i32

Source§

impl Element for i64

Source§

impl Element for i128

Source§

impl Element for u8

Source§

impl Element for u16

Source§

impl Element for u32

Source§

impl Element for u64

Source§

impl Element for u128

Source§

impl Element for Complex<f32>

Source§

impl Element for Complex<f64>

Implementors§