Skip to main content

ViewType

Trait ViewType 

Source
pub trait ViewType:
    Sealed
    + 'static
    + PartialEq
    + AsRef<Self> {
    type Owned: Debug + Clone + Sync + Send + AsRef<Self>;

    const IS_UTF8: bool;
    const DATA_TYPE: ArrowDataType;

    // Required methods
    unsafe fn from_bytes_unchecked(slice: &[u8]) -> &Self;
    fn from_bytes(slice: &[u8]) -> Option<&Self>;
    fn to_bytes(&self) -> &[u8] ;
    fn into_owned(&self) -> Self::Owned;
    fn dtype() -> &'static ArrowDataType;
}

Required Associated Constants§

Required Associated Types§

Source

type Owned: Debug + Clone + Sync + Send + AsRef<Self>

Required Methods§

Source

unsafe fn from_bytes_unchecked(slice: &[u8]) -> &Self

§Safety

The caller must ensure that slice is a valid view.

Source

fn from_bytes(slice: &[u8]) -> Option<&Self>

Source

fn to_bytes(&self) -> &[u8]

Source

fn into_owned(&self) -> Self::Owned

Source

fn dtype() -> &'static ArrowDataType

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ViewType for [u8]

Source§

const IS_UTF8: bool = false

Source§

const DATA_TYPE: ArrowDataType = ArrowDataType::BinaryView

Source§

type Owned = Vec<u8>

Source§

unsafe fn from_bytes_unchecked(slice: &[u8]) -> &Self

Source§

fn from_bytes(slice: &[u8]) -> Option<&Self>

Source§

fn to_bytes(&self) -> &[u8]

Source§

fn into_owned(&self) -> Self::Owned

Source§

fn dtype() -> &'static ArrowDataType

Source§

impl ViewType for str

Source§

const IS_UTF8: bool = true

Source§

const DATA_TYPE: ArrowDataType = ArrowDataType::Utf8View

Source§

type Owned = String

Source§

unsafe fn from_bytes_unchecked(slice: &[u8]) -> &Self

Source§

fn from_bytes(slice: &[u8]) -> Option<&Self>

Source§

fn to_bytes(&self) -> &[u8]

Source§

fn into_owned(&self) -> Self::Owned

Source§

fn dtype() -> &'static ArrowDataType

Implementors§