Struct random_access_memory::RandomAccessMemory [−][src]
pub struct RandomAccessMemory { /* fields omitted */ }
Main constructor.
Methods
impl RandomAccessMemory
[src]
impl RandomAccessMemory
pub fn new(page_size: usize) -> Self
[src]
pub fn new(page_size: usize) -> Self
Create a new instance.
pub fn default() -> Self
[src]
pub fn default() -> Self
Create a new instance with a 1mb page size.
pub fn with_buffers(page_size: usize, buffers: Vec<Vec<u8>>) -> Self
[src]
pub fn with_buffers(page_size: usize, buffers: Vec<Vec<u8>>) -> Self
Create a new instance, but pass the initial buffers to the constructor.
Trait Implementations
impl Debug for RandomAccessMemory
[src]
impl Debug for RandomAccessMemory
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl RandomAccess for RandomAccessMemory
[src]
impl RandomAccess for RandomAccessMemory
type Error = Error
An error.
fn write(&mut self, offset: usize, data: &[u8]) -> Result<(), Self::Error>
[src]
fn write(&mut self, offset: usize, data: &[u8]) -> Result<(), Self::Error>
Write bytes at an offset to the backend.
fn read(&mut self, offset: usize, length: usize) -> Result<Vec<u8>, Self::Error>
[src]
fn read(&mut self, offset: usize, length: usize) -> Result<Vec<u8>, Self::Error>
Read a sequence of bytes at an offset from the backend.
fn read_to_writer(
&mut self,
_offset: usize,
_length: usize,
_buf: &mut impl Write
) -> Result<(), Self::Error>
[src]
fn read_to_writer(
&mut self,
_offset: usize,
_length: usize,
_buf: &mut impl Write
) -> Result<(), Self::Error>
Read a sequence of bytes at an offset from the backend.
fn del(&mut self, offset: usize, length: usize) -> Result<(), Self::Error>
[src]
fn del(&mut self, offset: usize, length: usize) -> Result<(), Self::Error>
Delete a sequence of bytes at an offset from the backend.
Auto Trait Implementations
impl Send for RandomAccessMemory
impl Send for RandomAccessMemory
impl Sync for RandomAccessMemory
impl Sync for RandomAccessMemory