Struct distant_ssh2::Ssh2Session
source · [−]pub struct Ssh2Session { /* private fields */ }Expand description
Represents an ssh2 session
Implementations
sourceimpl Ssh2Session
impl Ssh2Session
sourcepub fn connect(host: impl AsRef<str>, opts: Ssh2SessionOpts) -> Result<Self>
pub fn connect(host: impl AsRef<str>, opts: Ssh2SessionOpts) -> Result<Self>
Connect to a remote TCP server using SSH
pub fn is_authenticated(&self) -> bool
sourcepub async fn authenticate(&mut self, handler: Ssh2AuthHandler<'_>) -> Result<()>
pub async fn authenticate(&mut self, handler: Ssh2AuthHandler<'_>) -> Result<()>
Authenticates the Ssh2Session if not already authenticated
sourcepub async fn into_distant_session(
self,
opts: IntoDistantSessionOpts
) -> Result<Session>
pub async fn into_distant_session(
self,
opts: IntoDistantSessionOpts
) -> Result<Session>
Consume Ssh2Session and produce a distant Session that is connected to a remote
distant server that is spawned using the ssh session
sourcepub async fn into_distant_session_info(
self,
opts: IntoDistantSessionOpts
) -> Result<SessionInfo>
pub async fn into_distant_session_info(
self,
opts: IntoDistantSessionOpts
) -> Result<SessionInfo>
Consume Ssh2Session and produce a distant SessionInfo representing a remote
distant server that is spawned using the ssh session
sourcepub async fn into_ssh_client_session(self) -> Result<Session>
pub async fn into_ssh_client_session(self) -> Result<Session>
Consume Ssh2Session and produce a distant Session that is powered by an ssh client
underneath
Auto Trait Implementations
impl RefUnwindSafe for Ssh2Session
impl Send for Ssh2Session
impl Sync for Ssh2Session
impl Unpin for Ssh2Session
impl UnwindSafe for Ssh2Session
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more