Skip to main content

OptionalCompatible

Trait OptionalCompatible 

Source
pub unsafe trait OptionalCompatible: AnyCompatible { }
Expand description

Marker for the types whose optional the ABI stores as one 16-byte TVMFFIAny cell, the types Optional<T> accepts.

Object types deliberately do not implement it: use Option<X>, one nullable pointer, for those.

§Safety

Implement only for types whose optional the ABI stores as a TVMFFIAny cell; for an object type it would mismatch the ABI’s nullable pointer.

ⓘ
use tvm_ffi::{Array, Optional};
let _ = Optional::<Array<i64>>::none();

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

Source§

impl OptionalCompatible for f32

Source§

impl OptionalCompatible for f64

Source§

impl OptionalCompatible for i8

Source§

impl OptionalCompatible for i16

Source§

impl OptionalCompatible for i32

Source§

impl OptionalCompatible for i64

Source§

impl OptionalCompatible for isize

Source§

impl OptionalCompatible for *mut c_void

Source§

impl OptionalCompatible for u8

Source§

impl OptionalCompatible for u16

Source§

impl OptionalCompatible for u32

Source§

impl OptionalCompatible for u64

Source§

impl OptionalCompatible for usize

Implementors§