Struct ssh_packet::Packet
source · pub struct Packet {
pub payload: Vec<u8>,
}
Expand description
A SSH 2.0 binary packet representation, including it’s encrypted payload.
see https://datatracker.ietf.org/doc/html/rfc4253#section-6.
Fields§
§payload: Vec<u8>
SSH packet’s payload as binary.
Implementations§
source§impl Packet
impl Packet
sourcepub fn read<T>(&self) -> Result<T, Error>where
for<'r> T: BinRead<Args<'r> = ()> + ReadEndian,
pub fn read<T>(&self) -> Result<T, Error>where for<'r> T: BinRead<Args<'r> = ()> + ReadEndian,
Decrypt the received Packet
from the remote into T
.
sourcepub fn write<T>(message: &T) -> Result<Self, Error>where
for<'w> T: BinWrite<Args<'w> = ()> + WriteEndian,
pub fn write<T>(message: &T) -> Result<Self, Error>where for<'w> T: BinWrite<Args<'w> = ()> + WriteEndian,
Write T
to a Packet
to be sent to the remote.
sourcepub async fn from_async_reader<R, C>(
reader: &mut R,
cipher: &mut C,
seq: u32
) -> Result<Self, C::Err>where
R: AsyncRead + Unpin,
C: OpeningCipher,
Available on crate feature futures
only.
pub async fn from_async_reader<R, C>( reader: &mut R, cipher: &mut C, seq: u32 ) -> Result<Self, C::Err>where R: AsyncRead + Unpin, C: OpeningCipher,
futures
only.Read a Packet
from the provided asynchronous reader
.
Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Packet
impl Send for Packet
impl Sync for Packet
impl Unpin for Packet
impl UnwindSafe for Packet
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