pub struct ShellNursery {
pub shells: HashMap<String, ShellProfile>,
}Expand description
Manages all shell profiles.
Fields§
§shells: HashMap<String, ShellProfile>Implementations§
Source§impl ShellNursery
impl ShellNursery
pub fn new() -> Self
Sourcepub fn spawn(
&mut self,
config: ShellConfig,
) -> Result<&mut ShellProfile, LifecycleError>
pub fn spawn( &mut self, config: ShellConfig, ) -> Result<&mut ShellProfile, LifecycleError>
Spawn a new shell from the given config.
Sourcepub fn kill(
&mut self,
id: &str,
reason: &str,
) -> Result<ShellProfile, LifecycleError>
pub fn kill( &mut self, id: &str, reason: &str, ) -> Result<ShellProfile, LifecycleError>
Kill a shell by id.
Sourcepub fn get(&self, id: &str) -> Option<&ShellProfile>
pub fn get(&self, id: &str) -> Option<&ShellProfile>
Get a shell profile by id.
Sourcepub fn get_mut(&mut self, id: &str) -> Option<&mut ShellProfile>
pub fn get_mut(&mut self, id: &str) -> Option<&mut ShellProfile>
Get a mutable reference to a shell profile by id.
Sourcepub fn running(&self) -> Vec<&ShellProfile>
pub fn running(&self) -> Vec<&ShellProfile>
Get all running shell profiles.
Sourcepub fn children_of(&self, parent_id: &str) -> Vec<&ShellProfile>
pub fn children_of(&self, parent_id: &str) -> Vec<&ShellProfile>
Get all children of a given parent.
Trait Implementations§
Source§impl Clone for ShellNursery
impl Clone for ShellNursery
Source§fn clone(&self) -> ShellNursery
fn clone(&self) -> ShellNursery
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ShellNursery
impl Debug for ShellNursery
Source§impl Default for ShellNursery
impl Default for ShellNursery
Source§fn default() -> ShellNursery
fn default() -> ShellNursery
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ShellNursery
impl<'de> Deserialize<'de> for ShellNursery
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
Source§impl PartialEq for ShellNursery
impl PartialEq for ShellNursery
Source§fn eq(&self, other: &ShellNursery) -> bool
fn eq(&self, other: &ShellNursery) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ShellNursery
impl Serialize for ShellNursery
impl StructuralPartialEq for ShellNursery
Auto Trait Implementations§
impl Freeze for ShellNursery
impl RefUnwindSafe for ShellNursery
impl Send for ShellNursery
impl Sync for ShellNursery
impl Unpin for ShellNursery
impl UnsafeUnpin for ShellNursery
impl UnwindSafe for ShellNursery
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