pub enum LoadResult {
Loaded(Vec<AdapterSnapshot>),
NotFound,
Corrupted {
reason: String,
},
}Expand description
Result of loading state from persistent storage.
Explicitly models all valid states to avoid ambiguity:
- Successfully loaded previous state
- No previous state exists (first run)
- State exists but is corrupted/unreadable
Variants§
Loaded(Vec<AdapterSnapshot>)
Successfully loaded previously saved snapshots.
NotFound
No state file exists (first run or explicitly deleted).
Corrupted
State file exists but could not be parsed. Program should continue with fresh state and overwrite on next save.
Implementations§
Source§impl LoadResult
impl LoadResult
Sourcepub fn into_snapshots(self) -> Vec<AdapterSnapshot>
pub fn into_snapshots(self) -> Vec<AdapterSnapshot>
Returns the loaded snapshots, or an empty vec for NotFound/Corrupted.
Trait Implementations§
Source§impl Clone for LoadResult
impl Clone for LoadResult
Source§fn clone(&self) -> LoadResult
fn clone(&self) -> LoadResult
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for LoadResult
impl RefUnwindSafe for LoadResult
impl Send for LoadResult
impl Sync for LoadResult
impl Unpin for LoadResult
impl UnwindSafe for LoadResult
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