Skip to main content

MemoryBacking

Trait MemoryBacking 

Source
pub trait MemoryBacking: Memory {
    // Required method
    fn backing_identity(&self) -> BackingIdentity;
}
Expand description

MemoryBacking

Host boundary for a backing whose aliases can be identified consistently.

All wrappers and clones over the same physical backing must return the same stable identity; independent backings must have different identities. Keep its identity allocation alive for the backing’s complete runtime/handle lifetime. A wrapper delegates to its underlying backing’s implementation. Obtaining the identity must not read, grow or write backing memory or create a manager/runtime; use a retained heap identity, not persisted contents. Implementing Memory alone does not establish this custody contract. Raw IO and unmanaged managers over a claimed backing remain prohibited; this is not an isolation boundary against arbitrary linked code or a dishonest backing.

Required Methods§

Source

fn backing_identity(&self) -> BackingIdentity

Return the physical backing identity under the trait’s host contract.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl<M: MemoryBacking> MemoryBacking for Rc<M>

Implementors§