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: for<'a> BinRead<Args<'a> = ()> + ReadEndian>(
&self
) -> Result<T, Error>
👎Deprecated since 0.2.2: please use the [to] method instead
pub fn read<T: for<'a> BinRead<Args<'a> = ()> + ReadEndian>( &self ) -> Result<T, Error>
to] method insteadDecrypt the received Packet from the remote into T.
sourcepub fn write<T: for<'a> BinWrite<Args<'a> = ()> + WriteEndian>(
message: &T
) -> Result<Self, Error>
👎Deprecated since 0.2.2: please use the [ToPacket] trait instead
pub fn write<T: for<'a> BinWrite<Args<'a> = ()> + WriteEndian>( message: &T ) -> Result<Self, Error>
ToPacket] trait insteadWrite T to a Packet to be sent to the remote.
sourcepub fn to<T: for<'a> BinRead<Args<'a> = ()> + ReadEndian>(
&self
) -> Result<T, Error>
pub fn to<T: for<'a> BinRead<Args<'a> = ()> + ReadEndian>( &self ) -> Result<T, Error>
Try to deserialize the Packet into T.
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