pub struct MirroredPageDevice<D> { /* private fields */ }Expand description
Owns two exclusive repair-capable devices. Extraction does not flush records. Both data syncs precede any metadata write; both decision syncs precede ACK.
Implementations§
Source§impl<D: RepairPageDevice> MirroredPageDevice<D>
impl<D: RepairPageDevice> MirroredPageDevice<D>
pub fn new(primary: D, secondary: D) -> Self
pub fn into_devices(self) -> [D; 2]
Trait Implementations§
Source§impl<D: RepairPageDevice> PageDevice for MirroredPageDevice<D>
impl<D: RepairPageDevice> PageDevice for MirroredPageDevice<D>
Source§fn sync_metadata(&mut self, slot: usize) -> Result<(), LinkError>
fn sync_metadata(&mut self, slot: usize) -> Result<(), LinkError>
Only the secondary copy can be unsynced: write_metadata and repair
sync the primary copy before anything else is written.
Source§fn metadata_flags(&self) -> u32
fn metadata_flags(&self) -> u32
Immutable physical format; the default preserves single-copy bytes.
fn supports_durable_flush(&self) -> bool
fn new_database_id(&mut self) -> Result<[u8; 16], LinkError>
fn data_length(&mut self) -> Result<u64, LinkError>
fn read_metadata(&mut self, slot: usize) -> Result<Option<Vec<u8>>, LinkError>
fn read_page(&mut self, _index: u64) -> Result<[u8; 4096], LinkError>
fn read_checked_page( &mut self, index: u64, expected: u64, ) -> Result<[u8; 4096], LinkError>
Source§fn complete_recovery(&mut self) -> Result<(), LinkError>
fn complete_recovery(&mut self) -> Result<(), LinkError>
Called only after the complete committed prefix validates.
fn write_page( &mut self, index: u64, bytes: &[u8; 4096], ) -> Result<(), LinkError>
fn sync_data(&mut self) -> Result<(), LinkError>
fn write_metadata( &mut self, slot: usize, bytes: &[u8; 128], ) -> Result<(), LinkError>
fn truncate_data(&mut self, length: u64) -> Result<(), LinkError>
Auto Trait Implementations§
impl<D> Freeze for MirroredPageDevice<D>where
D: Freeze,
impl<D> RefUnwindSafe for MirroredPageDevice<D>where
D: RefUnwindSafe,
impl<D> Send for MirroredPageDevice<D>where
D: Send,
impl<D> Sync for MirroredPageDevice<D>where
D: Sync,
impl<D> Unpin for MirroredPageDevice<D>where
D: Unpin,
impl<D> UnsafeUnpin for MirroredPageDevice<D>where
D: UnsafeUnpin,
impl<D> UnwindSafe for MirroredPageDevice<D>where
D: 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