#[non_exhaustive]pub enum RtmpError {
Show 22 variants
BufferTooShort(BufferTooShort),
Malformed {
what: &'static str,
},
ChunkSizeOutOfRange {
value: u32,
},
InvalidLimitType {
value: u8,
},
UnsupportedUserControlEvent {
value: u16,
},
UnsupportedAmf0Marker {
marker: u8,
},
Amf0DepthExceeded {
max: usize,
},
Amf0TooManyValues {
max: usize,
},
CommandTooLong {
len: usize,
max: usize,
},
Amf0StringTooLong {
len: usize,
},
CommandNameNotString {
value: Amf0Value,
},
CommandTransactionIdNotNumber {
value: Amf0Value,
},
HandshakeVersion {
value: u8,
expected: u8,
},
Amf0DateTimeZone {
value: u16,
},
Amf0Utf8 {
what: &'static str,
},
TooManyChunkStreams {
max: usize,
},
InputBudgetExceeded {
max: usize,
},
ChunkStreamState {
chunk_stream_id: u32,
what: &'static str,
},
UnexpectedState {
what: &'static str,
},
InvalidChunkStreamId {
chunk_stream_id: u32,
},
FieldOverflow(FieldOverflow),
OutputBufferTooSmall(OutputBufferTooSmall),
}Expand description
Errors produced by the RTMP ingest session engine.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
BufferTooShort(BufferTooShort)
Not enough input bytes were available to parse a complete structure (handshake message, chunk header, or reassembled RTMP message).
Malformed
The input did not conform to the expected wire layout (bad handshake
version, invalid chunk fmt/CSID encoding, a length that overruns
its buffer, or similar).
ChunkSizeOutOfRange
A Set Chunk Size announced a value this engine cannot adopt: zero, a
non-zero reserved top bit (§5.4.1), or above MAX_CHUNK_SIZE.
InvalidLimitType
A Set Peer Bandwidth carried a limit type byte outside 0..=2
(§5.4.5).
UnsupportedUserControlEvent
A User Control message carried an event type §6.7 does not define.
UnsupportedAmf0Marker
An AMF0 value used a marker this engine does not decode ([AMF0]
§2.1’s reserved, legacy and AMF3-switch markers).
Amf0DepthExceeded
AMF0 data nested containers deeper than
MAX_AMF0_DEPTH.
Amf0TooManyValues
AMF0 data held more values than
MAX_AMF0_VALUES — a wide container
(millions of one-byte nulls, or three-byte empty-key pairs) would
otherwise expand into millions of Amf0Values from one message.
CommandTooLong
A Command Message body was longer than
MAX_COMMAND_LEN.
Amf0StringTooLong
An AMF0 String carried more than the 65535 bytes its 16-bit length prefix can hold; AMF0 has no Long String variant to fall back on inside these messages.
CommandNameNotString
The first value of a Command Message body was not an AMF0 String (§7.1.1: the command name).
CommandTransactionIdNotNumber
The second value of a Command Message body was not an AMF0 Number (§7.1.1: the transaction id).
HandshakeVersion
The handshake version byte was not RTMP_VERSION
(§5.2.2).
Amf0DateTimeZone
An AMF0 Date carried a non-zero reserved time-zone field ([AMF0]
§2.13: it MUST be 0x0000).
Amf0Utf8
An AMF0 value was not valid UTF-8 where the format requires text
([AMF0] §2.4/§2.5/§2.14).
TooManyChunkStreams
Reassembly held more distinct chunk streams than the per-connection bound allows.
InputBudgetExceeded
The in-progress reassembly buffer grew past the per-connection budget (#1108/RTMP-W1).
ChunkStreamState
Assembling a message hit a chunk-stream state that cannot complete: a continuation before any chunk, a header on a completed message, a stream without a message type id, or a chunk that does not match its message’s declared length.
Fields
UnexpectedState
An operation was attempted, or a message arrived, that is not valid
in the session’s current state (e.g. a command received before the
handshake completed, or publish before createStream). The server
maps a rejected publish to NetStream.Publish.BadName; a client
sees a rejected stream key as this variant after publish.
InvalidChunkStreamId
A crate::chunk::Message was built with a chunk_stream_id outside
the basic header’s encodable range (2..=65599, RTMP §5.3.1.1), so it
cannot be written.
FieldOverflow(FieldOverflow)
A length or count did not fit the wire field it is written to
(#1129): a serializer that narrowed a usize with as u32 (then
packed it into a 24-bit field) would have silently wrapped and
emitted a misframed chunk stream; this is returned instead.
OutputBufferTooSmall(OutputBufferTooSmall)
The output buffer passed to serialize_into was smaller than
serialized_len().
Trait Implementations§
Source§impl Error for RtmpError
impl Error for RtmpError
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()