Struct distant_core::SessionInfo
source · [−]pub struct SessionInfo {
pub host: String,
pub port: u16,
pub key: SecretKey32,
}Fields
host: Stringport: u16key: SecretKey32Implementations
sourceimpl SessionInfo
impl SessionInfo
sourcepub fn from_environment() -> Result<Self>
pub fn from_environment() -> Result<Self>
Loads session from environment variables
sourcepub fn from_stdin() -> Result<Self>
pub fn from_stdin() -> Result<Self>
Loads session from the next line available in this program’s stdin
sourcepub fn into_key(self) -> SecretKey32
pub fn into_key(self) -> SecretKey32
Consumes the session and returns the key
sourcepub async fn to_ip_addr(&self) -> Result<IpAddr>
pub async fn to_ip_addr(&self) -> Result<IpAddr>
Returns the ip address associated with the session based on the host
sourcepub async fn to_socket_addr(&self) -> Result<SocketAddr>
pub async fn to_socket_addr(&self) -> Result<SocketAddr>
Returns socket address associated with the session
sourcepub fn key_to_unprotected_string(&self) -> String
pub fn key_to_unprotected_string(&self) -> String
Converts the session’s key to a hex string
sourcepub fn to_unprotected_string(&self) -> String
pub fn to_unprotected_string(&self) -> String
Converts to unprotected string that exposes the key in the form of
DISTANT CONNECT <host> <port> <key>
Trait Implementations
sourceimpl AsRef<SessionInfo> for SessionInfoFile
impl AsRef<SessionInfo> for SessionInfoFile
sourcefn as_ref(&self) -> &SessionInfo
fn as_ref(&self) -> &SessionInfo
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl Debug for SessionInfo
impl Debug for SessionInfo
sourceimpl From<SessionInfoFile> for SessionInfo
impl From<SessionInfoFile> for SessionInfo
sourcefn from(sf: SessionInfoFile) -> Self
fn from(sf: SessionInfoFile) -> Self
Converts to this type from the input type.
sourceimpl FromStr for SessionInfo
impl FromStr for SessionInfo
sourceimpl PartialEq<SessionInfo> for SessionInfo
impl PartialEq<SessionInfo> for SessionInfo
sourcefn eq(&self, other: &SessionInfo) -> bool
fn eq(&self, other: &SessionInfo) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &SessionInfo) -> bool
fn ne(&self, other: &SessionInfo) -> bool
This method tests for !=.
impl Eq for SessionInfo
impl StructuralEq for SessionInfo
impl StructuralPartialEq for SessionInfo
Auto Trait Implementations
impl RefUnwindSafe for SessionInfo
impl Send for SessionInfo
impl Sync for SessionInfo
impl Unpin for SessionInfo
impl UnwindSafe for SessionInfo
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