Skip to main content

MemoryDescriptor

Trait MemoryDescriptor 

Source
pub trait MemoryDescriptor:
    Send
    + Sync
    + Debug {
    // Required methods
    fn addr(&self) -> usize;
    fn size(&self) -> usize;
    fn storage_kind(&self) -> StorageKind;
    fn as_any(&self) -> &dyn Any;
    fn nixl_descriptor(&self) -> Option<NixlDescriptor>;
}
Expand description

Core trait for memory regions that can be type-erased.

This is the only trait in the storage API. Concrete storage types implement this trait to enable type erasure via Arc<dyn MemoryDescriptor>.

Required Methods§

Source

fn addr(&self) -> usize

Base address of the memory region.

Source

fn size(&self) -> usize

Size of the memory region in bytes.

Source

fn storage_kind(&self) -> StorageKind

Type of storage backing this region.

Source

fn as_any(&self) -> &dyn Any

Enable downcasting to concrete type.

Source

fn nixl_descriptor(&self) -> Option<NixlDescriptor>

Get the NIXL descriptor for this memory region.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementations on Foreign Types§

Source§

impl MemoryDescriptor for Arc<dyn NixlMemory + Send + Sync>

Source§

impl MemoryDescriptor for Arc<dyn TensorDescriptor + Send + Sync>

Source§

impl MemoryDescriptor for Arc<dyn TensorDescriptor>

Implementors§