Trait MemBlock

Source
pub trait MemBlock: Send {
    type Ref<'a>: MemBlock + Clone
       where Self: 'a;

    // Required methods
    fn device(&self) -> MemDevice;
    fn borrow(&self) -> Self::Ref<'_>;
    fn map_to_cpu(&self) -> &[u8] ;

    // Provided methods
    fn len(&self) -> usize { ... }
    fn layout(&self) -> Layout { ... }
    fn into_cpu_bytes(self) -> Bytes
       where Self: Sized { ... }
}

Required Associated Types§

Source

type Ref<'a>: MemBlock + Clone where Self: 'a

Required Methods§

Source

fn device(&self) -> MemDevice

Source

fn borrow(&self) -> Self::Ref<'_>

Source

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

Provided Methods§

Source

fn len(&self) -> usize

Source

fn layout(&self) -> Layout

Source

fn into_cpu_bytes(self) -> Bytes
where Self: Sized,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl MemBlock for Bytes

Source§

type Ref<'a> = &'a Bytes

Source§

fn borrow(&self) -> Self::Ref<'_>

Source§

fn device(&self) -> MemDevice

Source§

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

Source§

fn into_cpu_bytes(self) -> Bytes

Source§

impl<'a> MemBlock for &'a Bytes

Source§

type Ref<'b> = &'b [u8] where Self: 'b

Source§

fn borrow(&self) -> Self::Ref<'_>

Source§

fn device(&self) -> MemDevice

Source§

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

Source§

impl<'a> MemBlock for &'a [u8]

Source§

type Ref<'b> = &'b [u8] where Self: 'b

Source§

fn borrow(&self) -> Self::Ref<'_>

Source§

fn device(&self) -> MemDevice

Source§

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

Implementors§