Struct mem::std_impls::ReadOnly [] [src]

pub struct ReadOnly<M: MemoryBlock> { /* fields omitted */ }

Read-only wrapper for MemoryBlocks. Raises an error if you try to write to it. Reading simply gets passed through. Useful in cases where you dynamically dispatch between different blocks.

Trait Implementations

impl<M: MemoryBlock> MemoryMiddlewareCreator<M> for ReadOnly<M>
[src]

impl<M: MemoryBlock> MemoryBlock for ReadOnly<M>
[src]

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

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

Set a byte at address.

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. Read more

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. Read more