pub struct ProcessRegistry { /* private fields */ }Expand description
This process’s entry in a registry directory; removed on drop.
Implementations§
Source§impl ProcessRegistry
impl ProcessRegistry
Sourcepub fn default_dir() -> Option<PathBuf>
pub fn default_dir() -> Option<PathBuf>
$ASC_RUNTIME_DIR, else $XDG_RUNTIME_DIR/asc, else
<temp dir>/asc-<uid>/procs.
Sourcepub fn open(dir: impl Into<PathBuf>) -> Option<ProcessRegistry>
pub fn open(dir: impl Into<PathBuf>) -> Option<ProcessRegistry>
Register this process in dir (created private to the user). None
where processes cannot be told apart reliably (not Linux or macOS) or the
directory is unusable, e.g. owned by someone else.
pub fn dir(&self) -> &Path
Sourcepub fn update(&self, bytes: u64, busy: bool) -> Result<()>
pub fn update(&self, bytes: u64, busy: bool) -> Result<()>
Publish the bytes this process’s memory cache holds now, and whether it is serving a request.
Sourcepub fn others(&self) -> Vec<ProcessUsage>
pub fn others(&self) -> Vec<ProcessUsage>
Every other live registered process; entries of dead ones are removed.
Sourcepub fn others_in(dir: &Path) -> Vec<ProcessUsage>
pub fn others_in(dir: &Path) -> Vec<ProcessUsage>
ProcessRegistry::others of dir for a process that does not
register itself (a one-shot command).
Trait Implementations§
Source§impl Drop for ProcessRegistry
impl Drop for ProcessRegistry
Auto Trait Implementations§
impl Forget for ProcessRegistry
impl Freeze for ProcessRegistry
impl Move for ProcessRegistry
impl RefUnwindSafe for ProcessRegistry
impl Send for ProcessRegistry
impl Sync for ProcessRegistry
impl Unpin for ProcessRegistry
impl UnsafeUnpin for ProcessRegistry
impl UnwindSafe for ProcessRegistry
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