Trait caesar_core::shared::PacketSender
source · pub trait PacketSender {
// Required methods
fn send_packet(&self, destination: u8, packet: Value);
fn send_encrypted_packet(
&self,
key: &Option<Aes128Gcm>,
destination: u8,
value: Value
);
}Expand description
Represents a sender of packets.
This trait is used to send packets to a receiver. The send_packet method is used to send
a plain packet, and the send_encrypted_packet method is used to send an encrypted packet.
Required Methods§
sourcefn send_packet(&self, destination: u8, packet: Value)
fn send_packet(&self, destination: u8, packet: Value)
Sends a plain packet to a receiver.
This method sends a plain packet to a receiver. The destination argument specifies the
destination of the packet, and the packet argument is the packet to send.
sourcefn send_encrypted_packet(
&self,
key: &Option<Aes128Gcm>,
destination: u8,
value: Value
)
fn send_encrypted_packet( &self, key: &Option<Aes128Gcm>, destination: u8, value: Value )
Sends an encrypted packet to a receiver.
This method sends an encrypted packet to a receiver. The key argument is the encryption
key to use, the destination argument specifies the destination of the packet, and the
value argument is the packet to send.
Implementors§
impl PacketSender for Sender
Implementation of PacketSender for Sender struct.
This implementation of PacketSender for Sender struct provides methods
to send a packet to a receiver.