NativeDType

Trait NativeDType 

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

This trait is implemented by native Rust types that can be converted to and from Vortex scalar values. e.g. &str -> DType::Utf8 bool -> DType::Bool

The dtype is the one closet matching the domain of the rust type e.g. Option<T> -> Nullable DType.

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 NativeDType for &str

Source§

impl NativeDType for &[u8]

Source§

impl NativeDType for bool

Source§

impl NativeDType for f32

Source§

impl NativeDType for f64

Source§

impl NativeDType for i8

Source§

impl NativeDType for i16

Source§

impl NativeDType for i32

Source§

impl NativeDType for i64

Source§

impl NativeDType for u8

Source§

impl NativeDType for u16

Source§

impl NativeDType for u32

Source§

impl NativeDType for u64

Source§

impl NativeDType for String

Source§

impl NativeDType for f16

Source§

impl NativeDType for ByteBuffer

Source§

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

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> NativeDType for Vec<T>
where T: NativeDType,

Implementors§