4个版本
0.1.3 | 2022年2月5日 |
---|---|
0.1.2 | 2020年10月16日 |
0.1.1 | 2020年9月6日 |
0.1.0 | 2020年7月9日 |
#1875 in 嵌入式开发
3KB
BlockDevice特质
pub trait BlockDevice {
const BLOCK_SIZE: u32 = 512;
type Error;
fn read(&self, buf: &mut [u8], address: usize, number_of_blocks: usize) -> Result<(), Self::Error>;
fn write(&self, buf: &[u8], address: usize, number_of_blocks: usize) -> Result<(), Self::Error>;
}
lib.rs
:
BlockDevice特质
pub trait BlockDevice {
const BLOCK_SIZE: u32 = 512;
type Error;
fn read(&self, buf: &mut [u8], address: usize, number_of_blocks: usize) -> Result<(), Self::Error>;
fn write(&self, buf: &[u8], address: usize, number_of_blocks: usize) -> Result<(), Self::Error>;
}