Skip to main content

MemBlock

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 is_empty(&self) -> bool { ... }
    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 is_empty(&self) -> bool

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".

Implementations on Foreign Types§

Source§

impl MemBlock for &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 MemBlock for &[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]

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 MemBlock for Vec<u8>

Source§

type Ref<'a> = &'a [u8]

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

Implementors§