pub struct SSHClient<'a> { /* private fields */ }Expand description
An async SSH client instance
The run() method runs the session to completion, with application behaviour
defined by the CliBehaviour instance.
Once authentication has completed (authenticated() is called), the application
may open remote channels with open_session_pty() etc.
This is async executor agnostic, though requires the CliBehaviour instance
to be wrapped in a SunsetMutex.
Implementations§
Source§impl<'a> SSHClient<'a>
impl<'a> SSHClient<'a>
pub fn new(inbuf: &'a mut [u8], outbuf: &'a mut [u8]) -> Result<Self>
Sourcepub async fn run<C: CliBehaviour>(
&self,
rsock: &mut impl Read,
wsock: &mut impl Write,
b: &SunsetMutex<C>,
) -> Result<()>
pub async fn run<C: CliBehaviour>( &self, rsock: &mut impl Read, wsock: &mut impl Write, b: &SunsetMutex<C>, ) -> Result<()>
Runs the session to completion.
rsock and wsock are the SSH network channel (TCP port 22 or equivalent).
b is an instance of CliBehaviour which defines application behaviour.
pub async fn exit(&self)
pub async fn open_session_nopty(&'a self) -> Result<(ChanInOut<'a>, ChanIn<'a>)>
pub async fn open_session_pty(&'a self) -> Result<ChanInOut<'a>>
Auto Trait Implementations§
impl<'a> !Freeze for SSHClient<'a>
impl<'a> !RefUnwindSafe for SSHClient<'a>
impl<'a> Send for SSHClient<'a>
impl<'a> !Sync for SSHClient<'a>
impl<'a> Unpin for SSHClient<'a>
impl<'a> !UnwindSafe for SSHClient<'a>
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