pub struct TerminalStateManager { /* private fields */ }Expand description
Terminal state manager for multiple terminals
Implementations§
Source§impl TerminalStateManager
impl TerminalStateManager
pub fn new() -> Self
Sourcepub async fn add_terminal(&self, state: TerminalState)
pub async fn add_terminal(&self, state: TerminalState)
Add a new terminal state
Sourcepub async fn get_terminal(&self, id: &str) -> Option<TerminalState>
pub async fn get_terminal(&self, id: &str) -> Option<TerminalState>
Get terminal state
Sourcepub async fn update_terminal<F>(
&self,
id: &str,
updater: F,
) -> Result<(), String>where
F: FnOnce(&mut TerminalState),
pub async fn update_terminal<F>(
&self,
id: &str,
updater: F,
) -> Result<(), String>where
F: FnOnce(&mut TerminalState),
Update terminal state
Sourcepub async fn remove_terminal(&self, id: &str) -> Option<TerminalState>
pub async fn remove_terminal(&self, id: &str) -> Option<TerminalState>
Remove terminal state
Sourcepub async fn get_all_terminals(&self) -> Vec<TerminalState>
pub async fn get_all_terminals(&self) -> Vec<TerminalState>
Get all terminal states
Sourcepub async fn active_count(&self) -> usize
pub async fn active_count(&self) -> usize
Get active terminal count
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for TerminalStateManager
impl !UnwindSafe for TerminalStateManager
impl Freeze for TerminalStateManager
impl Send for TerminalStateManager
impl Sync for TerminalStateManager
impl Unpin for TerminalStateManager
impl UnsafeUnpin for TerminalStateManager
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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.