Filament referencefilament-packet
filament-packet · error
Source declarations, signatures and documentation for error.
Read the current implementation boundaries before integration. This reference reproduces declarations; it omits source comments whose examples or readiness claims have not been verified.
Source: sigil/weave/filament/filament-packet/src/error.rs. SHA-256: d098af3dc5ae4d683ce24f2c8eb1f796bb485a5bb9de6cd95cbeaf2211db7de1.
This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.
error::Result
pub type Result<T> = std::result::Result<T, PacketError>;Source line: 6.
error::PacketError
#[derive(Error, Debug, Clone, PartialEq, Eq)]
pub enum PacketError {
/// Insufficient data in buffer.
#[error("insufficient data: expected at least {expected} bytes, got {actual}")]
InsufficientData {
/// Expected number of bytes.
expected: usize,
/// Actual number of bytes available.
actual: usize,
},
/// Invalid packet type in header.
#[error("invalid packet type in header")]
InvalidPacketType,
/// Invalid destination type in header.
#[error("invalid destination type in header")]
InvalidDestinationType,
/// Packet exceeds maximum transmission unit.
#[error("packet size {size} exceeds MTU {mtu}")]
ExceedsMTU {
/// Actual packet size.
size: usize,
/// Maximum allowed size (MTU).
mtu: usize,
},
/// Hop count has reached zero.
#[error("hop count expired")]
HopCountExpired,
/// IFAC field size is invalid.
#[error("IFAC size {size} is outside valid range {min}-{max} bytes")]
InvalidIfacSize {
/// Actual IFAC size.
size: usize,
/// Minimum allowed size.
min: usize,
/// Maximum allowed size.
max: usize,
},
/// Address field has invalid size.
#[error("invalid address size: expected {expected}, got {actual}")]
InvalidAddressSize {
/// Expected address size.
expected: usize,
/// Actual address size.
actual: usize,
},
/// Packet is malformed or corrupted.
#[error("malformed packet: {reason}")]
Malformed {
/// Reason for malformation.
reason: String,
},
/// Data payload is too large for packet.
#[error("data payload ({size} bytes) too large for packet (max {max} bytes)")]
PayloadTooLarge {
/// Actual payload size.
size: usize,
/// Maximum allowed payload size.
max: usize,
},
/// Missing required field.
#[error("missing required field: {field}")]
MissingField {
/// Name of missing field.
field: &'static str,
},
}Source line: 10.