pub enum ProtocolCommand {
Show 16 variants
SendReliable {
channel_id: u8,
sequence: u16,
ordered: bool,
data: SharedBytes,
},
SendUnreliable {
channel_id: u8,
data: SharedBytes,
},
SendUnreliableSequenced {
channel_id: u8,
sequence: u16,
data: SharedBytes,
},
SendUnsequenced {
channel_id: u8,
unsequenced_group: u16,
data: SharedBytes,
},
SendFragment {
channel_id: u8,
sequence: u16,
ordered: bool,
fragment_id: u8,
fragment_count: u8,
data: SharedBytes,
},
SendUnreliableFragment {
channel_id: u8,
sequence: u16,
fragment_id: u8,
fragment_count: u8,
data: SharedBytes,
},
Acknowledge {
sequence: u16,
received_mask: u32,
sent_time: Option<u32>,
},
Ping {
timestamp: u32,
},
Pong {
timestamp: u32,
},
Connect {
channels: u8,
mtu: u16,
protocol_version: u16,
outgoing_session_id: u16,
connect_id: u32,
},
VerifyConnect {
peer_id: u16,
channels: u8,
mtu: u16,
incoming_session_id: u16,
outgoing_session_id: u16,
window_size: u32,
},
Disconnect {
reason: u32,
},
BandwidthLimit {
incoming: u32,
outgoing: u32,
},
ThrottleConfigure {
interval: u32,
acceleration: u32,
deceleration: u32,
},
PMTUProbe {
size: u16,
token: u32,
payload: SharedBytes,
},
PMTUReply {
size: u16,
token: u32,
},
}Expand description
Protocol commands that can be sent between peers.
All protocol operations are represented as discrete commands that can be aggregated.
Variants§
SendReliable
Send reliable data on a channel
Fields
data: SharedBytesPayload data (shared, sliceable)
SendUnreliable
Send unreliable data on a channel
SendUnreliableSequenced
Send sequenced unreliable data (drops old packets)
Fields
data: SharedBytesPayload data (shared slice)
SendUnsequenced
Send unsequenced unreliable data (prevents duplicates without ordering)
Fields
data: SharedBytesPayload data (shared slice)
SendFragment
Fragment of a larger reliable packet
Fields
data: SharedBytesFragment data (shared slice)
SendUnreliableFragment
Fragment of a larger unreliable packet
Fields
data: SharedBytesFragment data (shared slice)
Acknowledge
Acknowledge received reliable packets
Fields
Ping
Ping to measure RTT and keep connection alive
Pong
Pong response to ping
Connect
Request to establish connection (3-way handshake step 1)
Fields
VerifyConnect
Verify connection (3-way handshake step 2) - replaces old ConnectAck
Fields
Disconnect
Request to disconnect
BandwidthLimit
Bandwidth limit notification
Fields
ThrottleConfigure
Throttle configuration for congestion control
Fields
PMTUProbe
Path MTU probe: request to test a payload of given size
Fields
payload: SharedBytesProbe payload (shared slice) sized to size
PMTUReply
Path MTU reply: response to a PMTU probe
Implementations§
Source§impl ProtocolCommand
impl ProtocolCommand
Sourcepub fn command_type(&self) -> u8
pub fn command_type(&self) -> u8
Returns the command type identifier for serialization
Sourcepub fn is_reliable(&self) -> bool
pub fn is_reliable(&self) -> bool
Returns true if this command requires reliable delivery
Sourcepub fn channel_id(&self) -> Option<u8>
pub fn channel_id(&self) -> Option<u8>
Returns the channel ID if this is a data command
Trait Implementations§
Source§impl Clone for ProtocolCommand
impl Clone for ProtocolCommand
Source§fn clone(&self) -> ProtocolCommand
fn clone(&self) -> ProtocolCommand
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more