pub struct FileLifecycleManager;Expand description
File lifecycle management utilities for GraphFile
Implementations§
Source§impl FileLifecycleManager
impl FileLifecycleManager
Sourcepub fn create<P: AsRef<Path>>(path: P) -> NativeResult<GraphFile>
pub fn create<P: AsRef<Path>>(path: P) -> NativeResult<GraphFile>
Create a new graph file with initial header
Creates a new graph file with V2 format, initializes the header, writes initial state to disk, and sets up file structures.
Sourcepub fn open<P: AsRef<Path>>(path: P) -> NativeResult<GraphFile>
pub fn open<P: AsRef<Path>>(path: P) -> NativeResult<GraphFile>
Open an existing graph file
Opens an existing graph file, validates the V2 format, reads the header, and initializes file structures. Automatically migrates V2 format files to V3 format.
Sourcepub fn read_header(graph_file: &mut GraphFile) -> NativeResult<()>
pub fn read_header(graph_file: &mut GraphFile) -> NativeResult<()>
Read header from file
Reads and validates the persistent header from disk.
Sourcepub fn write_header(graph_file: &mut GraphFile) -> NativeResult<()>
pub fn write_header(graph_file: &mut GraphFile) -> NativeResult<()>
Write header to file with durable persistence
This is the ONLY authorized way to write to header region [0, HEADER_SIZE)
Sourcepub fn sync(graph_file: &GraphFile) -> NativeResult<()>
pub fn sync(graph_file: &GraphFile) -> NativeResult<()>
Sync file to disk
Ensures all buffered data is written to persistent storage.
Auto Trait Implementations§
impl Freeze for FileLifecycleManager
impl RefUnwindSafe for FileLifecycleManager
impl Send for FileLifecycleManager
impl Sync for FileLifecycleManager
impl Unpin for FileLifecycleManager
impl UnwindSafe for FileLifecycleManager
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> 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