pub enum SignalFishError {
TransportSend(String),
TransportReceive(String),
TransportClosed,
Serialization(Error),
NotConnected,
SendBufferFull {
capacity: usize,
},
NotInRoom,
ServerError {
message: String,
error_code: Option<ErrorCode>,
},
ProtocolUnsupported {
mode: &'static str,
},
BinaryFormatNotNegotiated,
Timeout,
Io(Error),
}Expand description
Errors that can occur when using the Signal Fish client.
Variants§
TransportSend(String)
Failed to send a message through the transport.
TransportReceive(String)
Failed to receive a message from the transport.
TransportClosed
The transport connection was closed unexpectedly.
Serialization(Error)
Failed to serialize or deserialize a protocol message.
NotConnected
Attempted an operation that requires an active connection, but the client is not connected.
SendBufferFull
The bounded outgoing command queue is full — the caller is producing messages faster than the transport can drain them.
This is the client’s send-side backpressure signal: nothing was lost,
the message was simply refused. Either retry later (e.g. next frame),
pace high-rate payloads with a waiting *_reliable variant
(SignalFishClient::send_game_data_reliable,
SignalFishClient::send_signal_reliable),
or raise
SignalFishConfig::command_channel_capacity.
NotInRoom
Attempted a room operation but the client is not in a room.
ServerError
The server returned an error message.
Fields
ProtocolUnsupported
A protocol-v3-only operation was attempted on a connection that has not negotiated v3.
The server would reject the message, so the client fails fast at the call
site instead — better UX than an asynchronous, unattributed error event.
Opt into relay/accountability v3 with
SignalFishConfig::enable_v3, or
opt into mesh signaling with
SignalFishConfig::enable_mesh.
Fields
mode: &'static strWhy v3 is unavailable:
"relay-only"— aProtocolInfowas received but negotiated below v3 (the v2 relay floor); waiting will not help. Enable the required v3 capabilities and reconnect."pre-negotiation"— noProtocolInfohas been received yet; negotiation is still in flight, so retry once it completes.
BinaryFormatNotNegotiated
Binary game data was requested without negotiating a binary encoding.
Timeout
An operation timed out.
Io(Error)
An I/O error occurred.
Trait Implementations§
Source§impl Debug for SignalFishError
impl Debug for SignalFishError
Source§impl Display for SignalFishError
impl Display for SignalFishError
Source§impl Error for SignalFishError
impl Error for SignalFishError
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()