Defines comprehensive error types for network transport operations including channel, packet, and serialization errors. Reuse when building reliable network communication layers.
// Source: https://github.com/cBournhonesque/lightyear | License: Apache-2.0
// Provided via justclaw.it.com; keep this notice with the code.
use crate::channel::ChannelKind;
use crate::channel::receive::ChannelReceiveError;
use crate::channel::registry::ChannelId;
use crate::packet::error::PacketError;
use bytes::Bytes;
use crossbeam_channel::TrySendError;
pub type Result<T> = core::result::Result<T, TransportError>;
#[derive(thiserror::Error, Debug)]
pub enum TransportError {
#[error(transparent)]
SerializationError(#[from] lightyear_serde::SerializationError),
#[error(transparent)]
PacketError(#[from] PacketError),
#[error("channel {0:?} was not found")]
ChannelNotFound(ChannelKind),
#[error("channel {0:?} was not found")]
ChannelIdNotFound(ChannelId),
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key