Trait AnyCast

Source
pub trait AnyCast<D: Dealloc>: Sized {
    // Required methods
    unsafe fn has_same_type(any_internal: u64) -> bool;
    unsafe fn move_to_any_internal(self) -> u64;
    unsafe fn from_any_internal(any_internal: u64) -> Self;

    // Provided method
    fn move_to_any(self) -> Any<D> { ... }
}

Required Methods§

Source

unsafe fn has_same_type(any_internal: u64) -> bool

Source

unsafe fn move_to_any_internal(self) -> u64

Source

unsafe fn from_any_internal(any_internal: u64) -> Self

Provided Methods§

Source

fn move_to_any(self) -> Any<D>

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<D: Dealloc> AnyCast<D> for f64

Source§

unsafe fn has_same_type(u: u64) -> bool

Source§

unsafe fn move_to_any_internal(self) -> u64

Source§

unsafe fn from_any_internal(u: u64) -> Self

Implementors§

Source§

impl<D: Dealloc, T: RefCast<D>> AnyCast<D> for Ref<T, D>

Source§

impl<D: Dealloc, T: ValueCast> AnyCast<D> for T
where u64: Cast<T>,