pub enum PortforwardingOperation {
Handshake,
TransferData(TransferData),
Error(ErrorOperation),
Status(Status),
OpenConnection(OpenConnection),
CloseConnection,
}
Expand description
Layer that represent portforwarding device message with good typing
Variants§
Handshake
TransferData(TransferData)
Error(ErrorOperation)
Status(Status)
OpenConnection(OpenConnection)
CloseConnection
Implementations§
source§impl PortforwardingOperation
impl PortforwardingOperation
sourcepub const fn new_close_connection() -> Self
pub const fn new_close_connection() -> Self
Close a connection payload
sourcepub const fn new_open_connection(port: TargetPort) -> Self
pub const fn new_open_connection(port: TargetPort) -> Self
generate open connection message
sourcepub const fn new_transfer_data(payload: Vec<u8>) -> Self
pub const fn new_transfer_data(payload: Vec<u8>) -> Self
generate transfer data message
sourcepub const fn new_connection_established() -> Self
pub const fn new_connection_established() -> Self
generate transfer data message
pub fn encode(self, version: &Version) -> Vec<u8>
pub fn decode( version: Version, payload: &[u8], operation: PortforwardingOperationTag ) -> Result<Self, Error>
Trait Implementations§
source§impl Clone for PortforwardingOperation
impl Clone for PortforwardingOperation
source§fn clone(&self) -> PortforwardingOperation
fn clone(&self) -> PortforwardingOperation
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for PortforwardingOperation
impl Debug for PortforwardingOperation
source§impl PartialEq for PortforwardingOperation
impl PartialEq for PortforwardingOperation
source§fn eq(&self, other: &PortforwardingOperation) -> bool
fn eq(&self, other: &PortforwardingOperation) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl TaggedEnum for PortforwardingOperation
impl TaggedEnum for PortforwardingOperation
impl Eq for PortforwardingOperation
impl StructuralPartialEq for PortforwardingOperation
Auto Trait Implementations§
impl Freeze for PortforwardingOperation
impl RefUnwindSafe for PortforwardingOperation
impl Send for PortforwardingOperation
impl Sync for PortforwardingOperation
impl Unpin for PortforwardingOperation
impl UnwindSafe for PortforwardingOperation
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