pub struct MirroredBlockDevice<B: BlockDevice> {
backend: B,
mirrored: bool,
usable_sectors: usize,
}Expand description
データの二重化 (ミラーリング) & 自動自己修復 (Self-Healing) を提供する上位ブロックデバイス層 SDカード等の外部不揮発性ストレージでは二重化を行い、 RAMディスク等の揮発性メモリでは多重化を行わずに全RAM容量を有効活用する。
Fields§
§backend: B§mirrored: bool§usable_sectors: usizeImplementations§
Source§impl<B: BlockDevice> MirroredBlockDevice<B>
impl<B: BlockDevice> MirroredBlockDevice<B>
pub fn new(backend: B) -> Self
pub fn new_mirrored(backend: B) -> Self
pub fn new_single(backend: B) -> Self
pub fn is_mirrored(&self) -> bool
pub fn total_usable_sectors(&self) -> usize
Sourcepub fn write_sector(
&mut self,
sector: usize,
data: &[u8],
) -> Result<(), &'static str>
pub fn write_sector( &mut self, sector: usize, data: &[u8], ) -> Result<(), &'static str>
チェックサム (CRC32) 付きでデータをセクタに書き込みします
Auto Trait Implementations§
impl<B> Freeze for MirroredBlockDevice<B>where
B: Freeze,
impl<B> RefUnwindSafe for MirroredBlockDevice<B>where
B: RefUnwindSafe,
impl<B> Send for MirroredBlockDevice<B>where
B: Send,
impl<B> Sync for MirroredBlockDevice<B>where
B: Sync,
impl<B> Unpin for MirroredBlockDevice<B>where
B: Unpin,
impl<B> UnsafeUnpin for MirroredBlockDevice<B>where
B: UnsafeUnpin,
impl<B> UnwindSafe for MirroredBlockDevice<B>where
B: UnwindSafe,
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