BlockRefDynamicWithMeta

Trait BlockRefDynamicWithMeta 

Source
pub unsafe trait BlockRefDynamicWithMeta: BlockRefDynamic {
    // Required method
    fn meta(state_ptr: NonNull<Self::State>) -> NonNull<dyn Any>;
}
Expand description

Implements the dynamic logic inside a BlockRef and can be used to create a BlockRefVTable that provides metadata to callers.

This is an extension of BlockRefDynamic that adds the ability to retrieve metadata about the memory block.

§Safety

A BlockRef may move between threads and be accessed from any thread, while different clones of a BlockRef may be accessed concurrently from different threads.

The implementation must accordingly be thread-safe to the degree required to correctly operate under these conditions.

Required Methods§

Source

fn meta(state_ptr: NonNull<Self::State>) -> NonNull<dyn Any>

Will be called to retrieve the memory provider specific metadata of the memory block.

Must return a pointer to an object whose lifetime it least as long as all clones of the BlockRef and which is valid for reads.

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.

Implementors§