Skip to main content

StableHostMemory

Trait StableHostMemory 

Source
pub unsafe trait StableHostMemory:
    Send
    + Sync
    + 'static {
    // Required method
    fn stable_bytes(&self) -> &[u8] ;
}
Expand description

Owner for host bytes whose address, length, and contents remain stable for the lifetime of the owner.

§Safety

Implementations must return the same readable allocation from Self::stable_bytes for their entire lifetime. The allocation must not be mutated while a retained region exists. Device backends may keep a native no-copy view after the source object that produced a payload has been dropped.

Required Methods§

Source

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

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§