Skip to main content

ContiguousMemory

Trait ContiguousMemory 

Source
pub trait ContiguousMemory {
    // Required methods
    fn as_ptr(&self) -> *const u8;
    fn layout(&self) -> &MemoryLayout;

    // Provided methods
    fn is_contiguous(&self) -> bool { ... }
    fn size_bytes(&self) -> usize { ... }
}
Expand description

Trait for types that have contiguous memory representation

Required Methods§

Source

fn as_ptr(&self) -> *const u8

Get a pointer to the start of the memory

Source

fn layout(&self) -> &MemoryLayout

Get the memory layout

Provided Methods§

Source

fn is_contiguous(&self) -> bool

Check if the memory is contiguous

Source

fn size_bytes(&self) -> usize

Get the size in bytes

Implementors§