pub struct StorageState {
pub next_file_id: u64,
pub config: StorageConfiguration,
pub files: BTreeMap<FileId, StorageFileState>,
pub path_to_file: BTreeMap<String, FileId>,
pub deleted_paths: HashSet<String>,
pub sync_failures: HashSet<(FileId, u64)>,
}Expand description
Storage-related state management for the simulation.
Fields§
§next_file_id: u64Counter for generating unique file IDs
config: StorageConfigurationStorage configuration for latencies and fault injection
files: BTreeMap<FileId, StorageFileState>Active files indexed by their ID
path_to_file: BTreeMap<String, FileId>Mapping from path to file ID for quick lookup
deleted_paths: HashSet<String>Set of paths that have been deleted (for create_new semantics)
sync_failures: HashSet<(FileId, u64)>Set of (file_id, op_seq) pairs for sync operations that failed
Implementations§
Source§impl StorageState
impl StorageState
Sourcepub fn new(config: StorageConfiguration) -> Self
pub fn new(config: StorageConfiguration) -> Self
Create a new storage state with the given configuration.
Trait Implementations§
Source§impl Debug for StorageState
impl Debug for StorageState
Auto Trait Implementations§
impl Freeze for StorageState
impl RefUnwindSafe for StorageState
impl Send for StorageState
impl Sync for StorageState
impl Unpin for StorageState
impl UnsafeUnpin for StorageState
impl UnwindSafe for StorageState
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