pub trait Keepalive: Send + Sync {
// Required methods
fn addr(&self) -> usize;
fn size(&self) -> usize;
// Provided method
fn downgrade(&self) -> Option<Arc<dyn WeakKeepalive>> { ... }
}Expand description
Trait for values that keep a backing memory allocation alive and know its address and size.
As long as a value implementing this trait exists, the memory region it describes is guaranteed to remain valid.
Required Methods§
Provided Methods§
Sourcefn downgrade(&self) -> Option<Arc<dyn WeakKeepalive>>
fn downgrade(&self) -> Option<Arc<dyn WeakKeepalive>>
Produce a WeakKeepalive pointing at the same underlying
resource. Defaults to None for impls with no weak form.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".