Trait mem::MemoryBlock [] [src]

pub trait MemoryBlock {
    fn get_size(&self) -> Addr;
fn set(&mut self, _: Addr, _: Byte) -> Result<(), Error>;
fn get(&self, _: Addr) -> Result<Byte, Error>; fn delete(&mut self, from: Addr, to: Addr) -> Result<(), Error> { ... }
fn flush(&mut self) -> Result<(), Error> { ... } }

Simple trait for a finite memory block.

Required Methods

Get the block's accessible size. Simply the highest address, NOT the number of addresses.

Set a byte at address.

Get a byte at address. Returns Ok(X) on success, where X will be the byte.

Provided Methods

Delete data at address. May allow the block to efficiently delete it, marking it as unused. This could allow the block to do wear leveling, for example.

Flush writes out. In case it does any form of caching, calling this method ensures it has written all the data it needs to write. Or, well, it fails otherwise.

Implementors