mirror of
https://github.com/LearningOS/rust-based-os-comp2022.git
synced 2026-02-09 05:14:46 +08:00
9 lines
264 B
Rust
9 lines
264 B
Rust
use core::any::Any;
|
|
|
|
/// Trait for block devices
|
|
/// which reads and writes data in the unit of blocks
|
|
pub trait BlockDevice : Send + Sync + Any {
|
|
fn read_block(&self, block_id: usize, buf: &mut [u8]);
|
|
fn write_block(&self, block_id: usize, buf: &[u8]);
|
|
}
|