Struct ssh_packet::SshId
source · pub struct SshId {
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 SshId
impl SshId
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 fn from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: BufRead,
pub fn from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: BufRead,
Read an SshId
, discarding any extra lines sent by the server
from the provided reader
.
sourcepub async fn from_async_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: AsyncBufRead + Unpin,
Available on crate feature futures
only.
pub async fn from_async_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: AsyncBufRead + Unpin,
futures
only.Read an SshId
, discarding any extra lines sent by the server
from the provided asynchronous reader
.
Trait Implementations§
source§impl PartialEq for SshId
impl PartialEq for SshId
impl Eq for SshId
impl StructuralPartialEq for SshId
Auto Trait Implementations§
impl RefUnwindSafe for SshId
impl Send for SshId
impl Sync for SshId
impl Unpin for SshId
impl UnwindSafe for SshId
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