pub struct FileService<'db> { /* private fields */ }Expand description
Read-only file activity, causal history, reconstruction, and safe publication operations.
Implementations§
Source§impl<'db> FileService<'db>
impl<'db> FileService<'db>
pub const fn new(db: &'db Db) -> Self
Sourcepub fn search(&self, query: &FileQuery) -> Result<Vec<FileEditSummary>>
pub fn search(&self, query: &FileQuery) -> Result<Vec<FileEditSummary>>
Aggregate matching file-edit rows.
§Complexity
Work is proportional to filtered edit rows; returned memory is proportional to grouped files and is unbounded only when the query explicitly uses a zero limit.
Sourcepub fn cross_reference(&self, query: &FileQuery) -> Result<Vec<FileCrossRef>>
pub fn cross_reference(&self, query: &FileQuery) -> Result<Vec<FileCrossRef>>
Return deterministic file/session edit-count pages using query.limit and query.offset.
Sourcepub fn history(&self, file: &str, query: &FileQuery) -> Result<Vec<FileVersion>>
pub fn history(&self, file: &str, query: &FileQuery) -> Result<Vec<FileVersion>>
Return causally ordered edits for one selected file.
§Complexity
Reconstruction work is proportional to matching versions and their stored edit payloads;
returned memory is bounded by query.limit unless it is explicitly zero. query.offset
skips versions after stable session/version ordering.
Sourcepub fn reconstruct(
&self,
file: &str,
query: &FileQuery,
version: Option<usize>,
) -> Result<ReconstructedFile>
pub fn reconstruct( &self, file: &str, query: &FileQuery, version: Option<usize>, ) -> Result<ReconstructedFile>
Replay edits through one requested version.
§Complexity
Time is proportional to replayed edit operations and content bytes; peak memory includes the reconstructed file plus the selected edit history.
Sourcepub fn reconstruct_versions(
&self,
file: &str,
query: &FileQuery,
) -> Result<ReconstructedFileVersions>
pub fn reconstruct_versions( &self, file: &str, query: &FileQuery, ) -> Result<ReconstructedFileVersions>
Lazily reconstruct every causally ordered version with a complete replay path.
Sourcepub fn publish_versions(
&self,
file: &str,
query: &FileQuery,
destination: &Path,
) -> Result<RecoveryPublicationReceipt>
pub fn publish_versions( &self, file: &str, query: &FileQuery, destination: &Path, ) -> Result<RecoveryPublicationReceipt>
Atomically publish every reconstructable version to a new non-replacing directory.
Trait Implementations§
Source§impl<'db> Clone for FileService<'db>
impl<'db> Clone for FileService<'db>
impl<'db> Copy for FileService<'db>
Auto Trait Implementations§
impl<'db> !RefUnwindSafe for FileService<'db>
impl<'db> !Send for FileService<'db>
impl<'db> !Sync for FileService<'db>
impl<'db> !UnwindSafe for FileService<'db>
impl<'db> Freeze for FileService<'db>
impl<'db> Unpin for FileService<'db>
impl<'db> UnsafeUnpin for FileService<'db>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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