Struct ssh_packet::Id
source · 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 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 Id
, 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 Id
, discarding any extra lines sent by the server
from the provided asynchronous reader
.
sourcepub fn to_writer<W>(&self, writer: &mut W) -> Result<(), Error>where
W: Write,
pub fn to_writer<W>(&self, writer: &mut W) -> Result<(), Error>where
W: Write,
Write the Id
to the provided writer
.
sourcepub async fn to_async_writer<W>(&self, writer: &mut W) -> Result<(), Error>where
W: AsyncWrite + Unpin,
Available on crate feature futures
only.
pub async fn to_async_writer<W>(&self, writer: &mut W) -> Result<(), Error>where
W: AsyncWrite + Unpin,
futures
only.Write the Id
to the provided asynchronous writer
.
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)