pub struct ShellSession { /* private fields */ }Expand description
A live interactive session opened by Client::shell.
Output and exit events arrive on the shared WS transport’s reader thread
and are handed to whatever callbacks are registered via
ShellSession::on_output / ShellSession::on_exit at the time they
arrive. Callbacks run holding the session’s internal lock, so they must
not call on_output/on_exit themselves (writing and resizing is fine).
Implementations§
Source§impl ShellSession
impl ShellSession
Sourcepub fn on_output(&self, cb: impl FnMut(&[u8]) + Send + 'static)
pub fn on_output(&self, cb: impl FnMut(&[u8]) + Send + 'static)
Register the output callback; anything buffered so far is flushed to it immediately.
Sourcepub fn on_exit(&self, cb: impl FnMut(i32) + Send + 'static)
pub fn on_exit(&self, cb: impl FnMut(i32) + Send + 'static)
Register the exit callback; a buffered exit fires immediately.
Sourcepub fn write(&self, data: impl AsRef<[u8]>) -> Result<()>
pub fn write(&self, data: impl AsRef<[u8]>) -> Result<()>
Send keystrokes (arbitrary bytes) to the session.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ShellSession
impl RefUnwindSafe for ShellSession
impl Send for ShellSession
impl Sync for ShellSession
impl Unpin for ShellSession
impl UnsafeUnpin for ShellSession
impl UnwindSafe for ShellSession
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