RdmaLocalMemory

Trait RdmaLocalMemory 

Source
pub trait RdmaLocalMemory:
    Send
    + Sync
    + Debug {
    // Required methods
    fn addr(&self) -> usize;
    fn size(&self) -> usize;
    fn read_at(&self, offset: usize, dst: &mut [u8]) -> Result<(), Error>;
    fn write_at(&self, offset: usize, src: &[u8]) -> Result<(), Error>;
}
Expand description

Handle to a contiguous region of local memory.

Implementations must guarantee the underlying allocation is valid for the lifetime of the implementor.

Required Methods§

Source

fn addr(&self) -> usize

Starting virtual address of the memory region.

Source

fn size(&self) -> usize

Size of the memory region in bytes.

Source

fn read_at(&self, offset: usize, dst: &mut [u8]) -> Result<(), Error>

Copy dst.len() bytes from this memory region starting at offset into dst.

Source

fn write_at(&self, offset: usize, src: &[u8]) -> Result<(), Error>

Copy src.len() bytes from src into this memory region starting at offset.

Implementors§