Skip to main content

RtmpError

Enum RtmpError 

Source
#[non_exhaustive]
pub enum RtmpError {
Show 22 variants BufferTooShort(BufferTooShort),
#[non_exhaustive]
Malformed { what: &'static str, },
#[non_exhaustive]
ChunkSizeOutOfRange { value: u32, },
#[non_exhaustive]
InvalidLimitType { value: u8, },
#[non_exhaustive]
UnsupportedUserControlEvent { value: u16, },
#[non_exhaustive]
UnsupportedAmf0Marker { marker: u8, },
#[non_exhaustive]
Amf0DepthExceeded { max: usize, },
#[non_exhaustive]
Amf0TooManyValues { max: usize, },
#[non_exhaustive]
CommandTooLong { len: usize, max: usize, },
#[non_exhaustive]
Amf0StringTooLong { len: usize, },
#[non_exhaustive]
CommandNameNotString { value: Amf0Value, },
#[non_exhaustive]
CommandTransactionIdNotNumber { value: Amf0Value, },
#[non_exhaustive]
HandshakeVersion { value: u8, expected: u8, },
#[non_exhaustive]
Amf0Utf8 { what: &'static str, },
#[non_exhaustive]
TooManyChunkStreams { max: usize, },
#[non_exhaustive]
InputBudgetExceeded { max: usize, },
#[non_exhaustive]
ChunkStreamState { chunk_stream_id: u32, what: &'static str, },
#[non_exhaustive]
UnexpectedState { what: &'static str, },
#[non_exhaustive]
InvalidChunkStreamId { chunk_stream_id: u32, }, FieldOverflow(FieldOverflow), OutputBufferTooSmall(OutputBufferTooSmall), Damage(DamageError),
}
Expand description

Errors produced by the RTMP ingest session engine.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

BufferTooShort(BufferTooShort)

Not enough input bytes were available to parse a complete structure (handshake message, chunk header, or reassembled RTMP message).

§

#[non_exhaustive]
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).

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§what: &'static str

What was being parsed when the malformed data was found.

§

#[non_exhaustive]
ChunkSizeOutOfRange

A Set Chunk Size announced a value this engine cannot adopt: zero, a non-zero reserved top bit (§5.4.1), or above the caller’s ChunkLimits::max_chunk_size.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§value: u32

The announced value, as it was on the wire.

§

#[non_exhaustive]
InvalidLimitType

A Set Peer Bandwidth carried a limit type byte outside 0..=2 (§5.4.5).

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§value: u8

The offending byte.

§

#[non_exhaustive]
UnsupportedUserControlEvent

A User Control message carried an event type §6.7 does not define.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§value: u16

The offending event type.

§

#[non_exhaustive]
UnsupportedAmf0Marker

An AMF0 value used a marker this engine does not decode ([AMF0] §2.1’s reserved, legacy and AMF3-switch markers).

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§marker: u8

The offending marker byte.

§

#[non_exhaustive]
Amf0DepthExceeded

AMF0 data nested containers deeper than the caller’s Amf0Limits::max_depth.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§max: usize

The limit that was reached.

§

#[non_exhaustive]
Amf0TooManyValues

AMF0 data held more values than the caller’s Amf0Limits::max_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.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§max: usize

The limit that was reached.

§

#[non_exhaustive]
CommandTooLong

A Command Message body was longer than the caller’s ServerLimits::max_command_len.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§len: usize

The body length that was rejected.

§max: usize

The limit that was reached.

§

#[non_exhaustive]
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.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§len: usize

The string’s length.

§

#[non_exhaustive]
CommandNameNotString

The first value of a Command Message body was not an AMF0 String (§7.1.1: the command name).

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§value: Amf0Value

The value that stood where the name belongs.

§

#[non_exhaustive]
CommandTransactionIdNotNumber

The second value of a Command Message body was not an AMF0 Number (§7.1.1: the transaction id).

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§value: Amf0Value

The value that stood where the transaction id belongs.

§

#[non_exhaustive]
HandshakeVersion

The handshake version byte was not RTMP_VERSION (§5.2.2).

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§value: u8

The version byte received.

§expected: u8

The version this engine speaks.

§

#[non_exhaustive]
Amf0Utf8

An AMF0 value was not valid UTF-8 where the format requires text ([AMF0] §2.4/§2.5/§2.14).

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§what: &'static str

What held the invalid text.

§

#[non_exhaustive]
TooManyChunkStreams

Reassembly held more distinct chunk streams than the per-connection bound allows.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§max: usize

The bound that was reached.

§

#[non_exhaustive]
InputBudgetExceeded

The in-progress reassembly buffer grew past the per-connection budget (#1108/RTMP-W1).

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§max: usize

The budget, in bytes.

§

#[non_exhaustive]
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

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§chunk_stream_id: u32

The chunk stream id whose state did not hold.

§what: &'static str

What was inconsistent.

§

#[non_exhaustive]
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.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§what: &'static str

Description of the state violation.

§

#[non_exhaustive]
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.

Fields

This variant is marked as non-exhaustive
Non-exhaustive enum variants could have additional fields added in future. Therefore, non-exhaustive enum variants cannot be constructed in external crates and cannot be matched against.
§chunk_stream_id: u32

The offending chunk stream id.

§

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().

§

Damage(DamageError)

The caller’s broadcast_core::damage::DamagePolicy refused a report the session was about to publish: the session ends with the same report inside this error.

Implementations§

Source§

impl RtmpError

Source

pub fn malformed(what: &'static str) -> Self

Trait Implementations§

Source§

impl Clone for RtmpError

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for RtmpError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for RtmpError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for RtmpError

Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Replaced by Error::source.
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<BufferTooShort> for RtmpError

Source§

fn from(source: BufferTooShort) -> Self

Converts to this type from the input type.
Source§

impl From<DamageError> for RtmpError

Source§

fn from(source: DamageError) -> Self

Converts to this type from the input type.
Source§

impl From<FieldOverflow> for RtmpError

Source§

fn from(source: FieldOverflow) -> Self

Converts to this type from the input type.
Source§

impl From<OutputBufferTooSmall> for RtmpError

Source§

fn from(source: OutputBufferTooSmall) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for RtmpError

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for RtmpError

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.