ScalarType

Trait ScalarType 

Source
pub trait ScalarType {
    // Required method
    fn dtype() -> DType;
}
Expand description

A trait for types that can be used as scalar values.

This trait is implemented by native Rust types that can be converted to and from Vortex scalar values.

Unless the type is an Option<T>, the DType that is returned by dtype() should ALWAYS be NonNullable.

Required Methods§

Source

fn dtype() -> DType

Returns the Vortex data type for this scalar type.

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

Source§

impl ScalarType for f32

Source§

impl ScalarType for f64

Source§

impl ScalarType for i8

Source§

impl ScalarType for i16

Source§

impl ScalarType for i32

Source§

impl ScalarType for i64

Source§

impl ScalarType for u8

Source§

impl ScalarType for u16

Source§

impl ScalarType for u32

Source§

impl ScalarType for u64

Source§

impl ScalarType for String

Source§

impl ScalarType for f16

Source§

impl ScalarType for BufferString

Source§

impl ScalarType for ByteBuffer

Source§

impl<T> ScalarType for Option<T>
where T: ScalarType,

It is common to represent a nullable type T as an Option<T>, so we implement a blanket implementation for all Option<T> to simply be a nullable T.

Source§

impl<T> ScalarType for Vec<T>
where T: ScalarType,

Implementors§