Expand description
§mem
A rather generic memory (block) interface. Use Mutexes if you need thread safety, this doesn’t provide any.
This crate is mainly for building emulators and such.
§But.. why?!
Because abstraction is great. Well, this is really just an abstraction around byte addressable storage. Doesn’t have to be RAM, could be a file or even a block device. Or some sort of remote memory interface. Or a live memory debugger/editor for an emulator! Let your imagination go wild! :)
Modules§
Traits§
- Memory
Block - Simple trait for a finite memory block.
- Memory
Block32be - Subtrait for 32 bit big-endian interface
- Memory
Block32le - Subtrait for 32 bit little-endian interface
- Memory
Creator - Simple
new(size)
trait for backends. - Memory
Middleware Creator - Trait for a new function that wraps another memory block, returning one itself.
Functions§
- copy
- Copy all of the
src
memory block todst
. ReturnsOk(writtenbytes)
to signifywrittenbytes
bytes have been copied, orErr(error)
if some error happened during copying. - copy_at
- Copy the contents of
src
atfrom
toto
todst
, starting atpos
. ReturnsOk(writtenbytes)
to signifywrittenbytes
bytes have been copied, orErr(error)
if some error happened during copying.