pub trait Store {
type Guard;
Show 13 methods
// Required methods
fn lock(&self) -> Result<Self::Guard>;
fn capacity(&self) -> u64;
fn read_at(&self, off: u64, len: usize) -> Result<Vec<u8>>;
fn write_at(&self, off: u64, bytes: &[u8]) -> Result<()>;
fn sync(&self) -> Result<()>;
fn read_checkpoint(&self) -> Result<Option<Vec<u8>>>;
fn write_checkpoint(&self, bytes: &[u8]) -> Result<()>;
fn read_sentinel(&self) -> Result<Option<Vec<u8>>>;
fn write_sentinel(&self, bytes: &[u8]) -> Result<()>;
fn fence(&self, txn: TxnId) -> Result<Option<u64>>;
fn set_fence(&self, txn: TxnId, epoch: u64) -> Result<()>;
fn create_fence(&self, txn: TxnId, epoch: u64) -> Result<()>;
fn forget_fences<F: Fn(TxnId) -> bool>(&self, keep: F) -> Result<Vec<TxnId>>;
}Required Associated Types§
Required Methods§
fn lock(&self) -> Result<Self::Guard>
fn capacity(&self) -> u64
Sourcefn read_at(&self, off: u64, len: usize) -> Result<Vec<u8>>
fn read_at(&self, off: u64, len: usize) -> Result<Vec<u8>>
Up to len bytes at off; shorter at the end of the preallocation.
fn write_at(&self, off: u64, bytes: &[u8]) -> Result<()>
fn sync(&self) -> Result<()>
fn read_checkpoint(&self) -> Result<Option<Vec<u8>>>
Sourcefn write_checkpoint(&self, bytes: &[u8]) -> Result<()>
fn write_checkpoint(&self, bytes: &[u8]) -> Result<()>
Atomic: either the old checkpoint or the complete new one survives.
fn read_sentinel(&self) -> Result<Option<Vec<u8>>>
fn write_sentinel(&self, bytes: &[u8]) -> Result<()>
Sourcefn fence(&self, txn: TxnId) -> Result<Option<u64>>
fn fence(&self, txn: TxnId) -> Result<Option<u64>>
The epoch backends fence on. Written before the journal’s Takeover record.
fn set_fence(&self, txn: TxnId, epoch: u64) -> Result<()>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.