Files
prometeu-runtime/crates/console/prometeu-system/src/os/facades/fs.rs
T
bquarkz 4d2ea6400d
Intrepid/Prometeu/Runtime/pipeline/head This commit looks good
Intrepid/Prometeu/Runtime/pipeline/pr-master This commit looks good
implements PLN-0058
2026-05-15 06:55:26 +01:00

27 lines
636 B
Rust

use crate::fs::{FsBackend, FsState};
use crate::os::SystemOS;
pub struct FsFacade<'a> {
pub(in crate::os) os: &'a mut SystemOS,
}
impl<'a> FsFacade<'a> {
pub fn needs_mount(&self) -> bool {
matches!(self.os.fs_state, FsState::Unmounted | FsState::Error(_))
}
pub fn mount(&mut self, backend: Box<dyn FsBackend>) {
self.os.vm_runtime.mount_fs(
&mut self.os.log_service,
&mut self.os.fs,
&mut self.os.fs_state,
backend,
);
}
pub fn unmount(&mut self) {
self.os.fs.unmount();
self.os.fs_state = FsState::Unmounted;
}
}