pub struct SystemState {
pub now: Option<Instant>,
pub times: Times,
pub executor: Option<Rc<dyn Executor>>,
pub processes: BTreeMap<Pid, Process>,
pub foreground: Option<Pid>,
pub file_system: FileSystem,
pub home_dirs: HashMap<String, PathBuf>,
pub path: UnixString,
}Expand description
State of the virtual system.
Fields§
§now: Option<Instant>Current time
times: TimesConsumed CPU time
executor: Option<Rc<dyn Executor>>Task manager that can execute asynchronous tasks
The virtual system uses this executor to run (virtual) child processes.
If executor is None, VirtualSystem::new_child_process will fail.
processes: BTreeMap<Pid, Process>Processes running in the system
foreground: Option<Pid>Process group ID of the foreground process group
Note: The current implementation does not support the notion of controlling terminals and sessions. This item may be replaced with a more correct implementation in the future.
file_system: FileSystemCollection of files existing in the virtual system
home_dirs: HashMap<String, PathBuf>Map from user names to their home directory paths
VirtualSystem::getpwnam_dir looks up its argument in this
dictionary.
path: UnixStringStandard path returned by VirtualSystem::confstr_path
Implementations§
Source§impl SystemState
impl SystemState
Sourcepub fn select_all(this: &RefCell<Self>)
pub fn select_all(this: &RefCell<Self>)
Performs select on all
processes in the system.
Any errors are ignored.
The RefCell must not have been borrowed, or this function will panic
with a double borrow.
Trait Implementations§
Source§impl Clone for SystemState
impl Clone for SystemState
Source§fn clone(&self) -> SystemState
fn clone(&self) -> SystemState
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SystemState
impl Debug for SystemState
Source§impl Default for SystemState
impl Default for SystemState
Source§fn default() -> SystemState
fn default() -> SystemState
Auto Trait Implementations§
impl Freeze for SystemState
impl !RefUnwindSafe for SystemState
impl !Send for SystemState
impl !Sync for SystemState
impl Unpin for SystemState
impl !UnwindSafe for SystemState
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> 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