Skip to main content

DirectBlockDevice

Trait DirectBlockDevice 

Source
pub trait DirectBlockDevice: DirectBaseOperations + MountOperations {
    // Provided methods
    fn get_block_size(&self) -> Result<u32> { ... }
    fn get_block_count(&self) -> Result<Size> { ... }
    fn erase(&self, position: Size, size: Size) -> Result<()> { ... }
}

Provided Methods§

Source

fn get_block_size(&self) -> Result<u32>

Source

fn get_block_count(&self) -> Result<Size>

Source

fn erase(&self, position: Size, size: Size) -> Result<()>

Prepare a byte range for writing, as raw flash requires before programming.

The range reads back unspecified data afterwards, and any write to it then succeeds. Devices that can rewrite in place need not implement ERASE: callers treat IoErrorKind::Unsupported as “nothing to do”.

Implementors§

Source§

impl<'a, D: DirectBlockDevice> DirectBlockDevice for PartitionDevice<'a, D>

Source§

impl<const BLOCK_SIZE: u32> DirectBlockDevice for MemoryDevice<BLOCK_SIZE>