pub trait PacketModifier {
// Required method
fn new(_: Config) -> Self
where Self: Sized;
// Provided methods
fn outgoing(&mut self, _: &[u8]) -> Option<Vec<u8>> { ... }
fn incoming(&mut self, _: &[u8]) -> Option<Vec<u8>> { ... }
}
Expand description
Trait describing optional per-packet payload modification logic.
Required Methods§
Provided Methods§
Sourcefn outgoing(&mut self, _: &[u8]) -> Option<Vec<u8>>
fn outgoing(&mut self, _: &[u8]) -> Option<Vec<u8>>
Method that is called for payload modification before a packet is send over a connection’s underlying socket.
The default implementation does not actually perform any kind of modification and leaves the payload to be send untouched.
Sourcefn incoming(&mut self, _: &[u8]) -> Option<Vec<u8>>
fn incoming(&mut self, _: &[u8]) -> Option<Vec<u8>>
Method that is called for payload modification purposes after a packet is received over a connection’s underlying socket.
The default implementation does not actually perform any kind of modification and returns leaves received payload untouched.