pub struct ProcessStore {
pub processes: Vec<ProcessEntry>,
}Fields§
§processes: Vec<ProcessEntry>Implementations§
Source§impl ProcessStore
impl ProcessStore
Sourcepub fn load() -> Result<Self>
pub fn load() -> Result<Self>
Load process store from disk. Returns empty store if the file doesn’t exist.
Sourcepub fn add(&mut self, entry: ProcessEntry)
pub fn add(&mut self, entry: ProcessEntry)
Add a new process entry, replacing any existing entry with the same id.
Sourcepub fn update_status(&mut self, id: &str, status: &str, exit_code: Option<i32>)
pub fn update_status(&mut self, id: &str, status: &str, exit_code: Option<i32>)
Update the status and exit metadata for a process entry.
Sourcepub fn find(&self, id: &str) -> Option<&ProcessEntry>
pub fn find(&self, id: &str) -> Option<&ProcessEntry>
Find a process entry by id.
Sourcepub fn list_recent(&self, limit: Option<usize>) -> Vec<&ProcessEntry>
pub fn list_recent(&self, limit: Option<usize>) -> Vec<&ProcessEntry>
List process entries sorted by started_at descending (newest first).
Trait Implementations§
Source§impl Clone for ProcessStore
impl Clone for ProcessStore
Source§fn clone(&self) -> ProcessStore
fn clone(&self) -> ProcessStore
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 moreSource§impl Debug for ProcessStore
impl Debug for ProcessStore
Source§impl Default for ProcessStore
impl Default for ProcessStore
Source§fn default() -> ProcessStore
fn default() -> ProcessStore
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ProcessStore
impl<'de> Deserialize<'de> for ProcessStore
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ProcessStore
impl RefUnwindSafe for ProcessStore
impl Send for ProcessStore
impl Sync for ProcessStore
impl Unpin for ProcessStore
impl UnsafeUnpin for ProcessStore
impl UnwindSafe for ProcessStore
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