Trait cobalt::PacketModifier
[−]
[src]
pub trait PacketModifier { fn new(_: Config) -> Self
where
Self: Sized; fn outgoing(&mut self, _: &[u8]) -> Option<Vec<u8>> { ... } fn incoming(&mut self, _: &[u8]) -> Option<Vec<u8>> { ... } }
Trait describing optional per-packet payload modification logic.
Required Methods
fn new(_: Config) -> Self where
Self: Sized,
Self: Sized,
Method that constructs a new packet modifier using the provided configuration.
Provided Methods
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.
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.
Trait Implementations
impl Debug for PacketModifier
[src]
Implementors
impl PacketModifier for NoopPacketModifier