Skip to main content

HostElement

Trait HostElement 

Source
pub unsafe trait HostElement: Copy + 'static {
    const ELEMENT_TYPE: ElementType;
}
Expand description

A Rust type that can be copied to and from a Buffer as is.

§Safety

Implementors must be plain old data without padding whose in-memory representation matches HostElement::ELEMENT_TYPE, and every bit pattern of that size must be a valid value.

Required Associated Constants§

Source

const ELEMENT_TYPE: ElementType

The matching element type.

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 HostElement for f32

Source§

const ELEMENT_TYPE: ElementType = ElementType::F32

Source§

impl HostElement for f64

Source§

const ELEMENT_TYPE: ElementType = ElementType::F64

Source§

impl HostElement for i8

Source§

const ELEMENT_TYPE: ElementType = ElementType::S8

Source§

impl HostElement for i16

Source§

const ELEMENT_TYPE: ElementType = ElementType::S16

Source§

impl HostElement for i32

Source§

const ELEMENT_TYPE: ElementType = ElementType::S32

Source§

impl HostElement for i64

Source§

const ELEMENT_TYPE: ElementType = ElementType::S64

Source§

impl HostElement for u8

Source§

const ELEMENT_TYPE: ElementType = ElementType::U8

Source§

impl HostElement for u16

Source§

const ELEMENT_TYPE: ElementType = ElementType::U16

Source§

impl HostElement for u32

Source§

const ELEMENT_TYPE: ElementType = ElementType::U32

Source§

impl HostElement for u64

Source§

const ELEMENT_TYPE: ElementType = ElementType::U64

Implementors§