pub struct SshSessionTag { /* private fields */ }Expand description
Handle to one dequeued SSH session instance.
Cloning the value shares the session; metadata reads never consume. Display shows id and peer only: the command string may carry secrets.
Implementations§
Source§impl SshSessionTag
impl SshSessionTag
pub fn new( command: Option<String>, username: Option<String>, peer_addr: Option<SocketAddr>, pty_size: Arc<SizeCell>, up_rx: Receiver<UpMsg>, down_tx: Sender<DownMsg>, ) -> Self
Sourcepub fn send_exit_status(&self, code: u32) -> Result<()>
pub fn send_exit_status(&self, code: u32) -> Result<()>
Queue an exit-status request for the client. Usable before the
pump finishes; after that it bails, so a late send fails loudly
instead of hanging a client that already saw the close. Never
blocks: a saturated queue means the wire side is wedged behind
network backpressure, and parking the reporter on it would stall
teardown behind a dead network. That failure also bails loudly.
Sourcepub fn finish_pump(&self)
pub fn finish_pump(&self)
Release the control sender once the byte pump finishes. The wire writer then observes the drain and closes the channel promptly, even while the script still holds the session. Idempotent.
pub fn command(&self) -> Option<String>
pub fn username(&self) -> Option<String>
pub fn peer_addr(&self) -> Option<SocketAddr>
Sourcepub fn pty_size_handle(&self) -> Arc<SizeCell> ⓘ
pub fn pty_size_handle(&self) -> Arc<SizeCell> ⓘ
Shareable handle to this session’s size cell, for its pty pump.
Sourcepub fn take_pump_ends(&self) -> Result<(Receiver<UpMsg>, Sender<DownMsg>)>
pub fn take_pump_ends(&self) -> Result<(Receiver<UpMsg>, Sender<DownMsg>)>
Take the pump ends for SSH_PUMP_CHANNEL. A second pump on the
same session bails instead of splitting bytes across pumps. The
check runs before either take so a failed pump mutates nothing.
Trait Implementations§
Source§impl Clone for SshSessionTag
impl Clone for SshSessionTag
Source§impl Debug for SshSessionTag
impl Debug for SshSessionTag
Source§impl Display for SshSessionTag
impl Display for SshSessionTag
Source§impl OxDockType for SshSessionTag
impl OxDockType for SshSessionTag
Source§fn descriptor() -> &'static TypeDescriptor
fn descriptor() -> &'static TypeDescriptor
Auto Trait Implementations§
impl Forget for SshSessionTag
impl Freeze for SshSessionTag
impl RefUnwindSafe for SshSessionTag
impl Send for SshSessionTag
impl Sync for SshSessionTag
impl Unpin for SshSessionTag
impl UnsafeUnpin for SshSessionTag
impl UnwindSafe for SshSessionTag
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.