pub struct Id {
pub protoversion: String,
pub softwareversion: String,
pub comments: Option<String>,
}
Expand description
The SSH identification string as defined in the SSH protocol.
The format must match the following pattern:
SSH-<protoversion>-<softwareversion>[ <comments>]
.
see https://datatracker.ietf.org/doc/html/rfc4253#section-4.2.
Fields§
§protoversion: String
The SSH’s protocol version, should be 2.0
in our case.
softwareversion: String
A string identifying the software curently used, in example billsSSH_3.6.3q3
.
comments: Option<String>
Optional comments with additionnal informations about the software.
Implementations§
Source§impl Id
impl Id
Sourcepub fn v2(
softwareversion: impl Into<String>,
comments: Option<impl Into<String>>,
) -> Self
pub fn v2( softwareversion: impl Into<String>, comments: Option<impl Into<String>>, ) -> Self
Convenience method to create an SSH-2.0
identifier string.
Sourcepub async fn from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: AsyncBufRead + Unpin,
Available on crate feature futures
only.
pub async fn from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: AsyncBufRead + Unpin,
futures
only.Read an Id
, discarding any extra lines sent by the server
from the provided asynchronous reader
.
Trait Implementations§
impl Eq for Id
impl StructuralPartialEq for Id
Auto Trait Implementations§
impl Freeze for Id
impl RefUnwindSafe for Id
impl Send for Id
impl Sync for Id
impl Unpin for Id
impl UnwindSafe for Id
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