[][src]Struct rml_rtmp::messages::MessagePayload

pub struct MessagePayload {
    pub timestamp: RtmpTimestamp,
    pub type_id: u8,
    pub message_stream_id: u32,
    pub data: Bytes,
}

Represents a raw RTMP message

Fields

timestamp: RtmpTimestamptype_id: u8message_stream_id: u32data: Bytes

Methods

impl MessagePayload
[src]

pub fn new() -> MessagePayload
[src]

Creates a new message payload with default values.

This is mostly used when all information about a message is not known at creation time but instead is built up over time (e.g. RTMP chunk deserialization process).

pub fn to_rtmp_message(
    &self
) -> Result<RtmpMessage, MessageDeserializationError>
[src]

Deserializes the message data in the specified payload into its corresponding RtmpMessage.

Note that flash clients (like Wowza's test client) lie and mark amf0 data and commands as amf3 values. It is unknown why this happens, but any Amf3 command/data messages that are seen are deserialized as amf0. So far this has not caused any issues.

pub fn from_rtmp_message(
    message: RtmpMessage,
    timestamp: RtmpTimestamp,
    message_stream_id: u32
) -> Result<MessagePayload, MessageSerializationError>
[src]

This creates a MessagePayload from an RtmpMessage.

Since RTMP messages do not contain timestamp or the conversation stream id these must be provided at the time of creation.

Trait Implementations

impl PartialEq<MessagePayload> for MessagePayload
[src]

impl Debug for MessagePayload
[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same for T

type Output = T

Should always be Self