pub trait BlockDevice {
// Required methods
fn total_sectors(&self) -> usize;
fn read_raw_sector(
&mut self,
sector: usize,
buf: &mut [u8],
) -> Result<(), &'static str>;
fn write_raw_sector(
&mut self,
sector: usize,
buf: &[u8],
) -> Result<(), &'static str>;
// Provided method
fn should_mirror(&self) -> bool { ... }
}Expand description
抽象ブロックデバイスの動作を規定するトレイト
Required Methods§
Sourcefn total_sectors(&self) -> usize
fn total_sectors(&self) -> usize
デバイスの総セクタ数を取得します
Provided Methods§
Sourcefn should_mirror(&self) -> bool
fn should_mirror(&self) -> bool
データの二重化(ミラーリング)が必要な外部記憶デバイスかどうか
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".