Struct driver_block::ramdisk::RamDisk  
source · pub struct RamDisk { /* private fields */ }Available on crate feature 
ramdisk only.Expand description
A RAM disk that stores data in a vector.
Implementations§
source§impl RamDisk
 
impl RamDisk
sourcepub fn new(size_hint: usize) -> Self
 
pub fn new(size_hint: usize) -> Self
Creates a new RAM disk with the given size hint.
The actual size of the RAM disk will be aligned upwards to the block size (512 bytes).
Trait Implementations§
source§impl BaseDriverOps for RamDisk
 
impl BaseDriverOps for RamDisk
source§fn device_type(&self) -> DeviceType
 
fn device_type(&self) -> DeviceType
The type of the device.
source§fn device_name(&self) -> &str
 
fn device_name(&self) -> &str
The name of the device.
source§impl BlockDriverOps for RamDisk
 
impl BlockDriverOps for RamDisk
source§fn num_blocks(&self) -> u64
 
fn num_blocks(&self) -> u64
The number of blocks in this storage device. Read more
source§fn block_size(&self) -> usize
 
fn block_size(&self) -> usize
The size of each block in bytes.
source§fn read_block(&mut self, block_id: u64, buf: &mut [u8]) -> DevResult
 
fn read_block(&mut self, block_id: u64, buf: &mut [u8]) -> DevResult
Reads blocked data from the given block. Read more
Auto Trait Implementations§
impl RefUnwindSafe for RamDisk
impl Send for RamDisk
impl Sync for RamDisk
impl Unpin for RamDisk
impl UnwindSafe for RamDisk
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
    T: ?Sized,
 
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
 
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more