Struct spacetimedb_commitlog::repo::Fs
source · pub struct Fs { /* private fields */ }Expand description
A commitlog repository Repo which stores commits in ordinary files on
disk.
Implementations§
source§impl Fs
impl Fs
sourcepub fn new(root: impl Into<PathBuf>) -> Self
pub fn new(root: impl Into<PathBuf>) -> Self
Create a commitlog repository which stores segments in the directory root.
root must name an extant, accessible, writeable directory.
sourcepub fn segment_path(&self, offset: u64) -> PathBuf
pub fn segment_path(&self, offset: u64) -> PathBuf
Get the filename for a segment starting with offset within this
repository.
sourcepub fn size_on_disk(&self) -> Result<u64>
pub fn size_on_disk(&self) -> Result<u64>
Determine the size on disk as the sum of the sizes of all segments.
Note that the actively written-to segment (if any) is included.
Trait Implementations§
source§impl Repo for Fs
impl Repo for Fs
source§type Segment = File
type Segment = File
The type of log segments managed by this repo, which must behave like a file.
source§fn create_segment(&self, offset: u64) -> Result<Self::Segment>
fn create_segment(&self, offset: u64) -> Result<Self::Segment>
Create a new segment with the minimum transaction offset
offset. Read moresource§fn open_segment(&self, offset: u64) -> Result<Self::Segment>
fn open_segment(&self, offset: u64) -> Result<Self::Segment>
Open an existing segment at the minimum transaction offset
offset. Read moreAuto Trait Implementations§
impl Freeze for Fs
impl RefUnwindSafe for Fs
impl Send for Fs
impl Sync for Fs
impl Unpin for Fs
impl UnwindSafe for Fs
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit)source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more