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]
fn get_size(&self) -> Addr
[src]
Get the block's accessible size. Simply the highest address, NOT the number of addresses. Read more
fn get(&self, addr: Addr) -> Result<Byte, Error>
[src]
Get a byte at address. Returns Ok(X)
on success, where X will be the byte. Read more
fn set(&mut self, addr: Addr, _: Byte) -> Result<(), Error>
[src]
Set a byte at address.
fn delete(&mut self, from: Addr, to: Addr) -> Result<(), Error>
[src]
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
fn flush(&mut self) -> Result<(), Error>
[src]
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