pub struct Command {
pub name: String,
pub transaction_id: f64,
pub arguments: Vec<Amf0Value>,
}Expand description
An RTMP Command Message body (§7.1.1): name (AMF0 String) + AMF0
transaction_id (AMF0 Number) + zero or more argument values (typically
a Command Object, then optional trailing arguments) — see docs/rtmp.md
§8.2’s closing note and §6.1 (Command Message).
This is the message-body-level container: unlike Amf0Value it is not
itself a single AMF0 value-type, so it uses inherent parse/to_body
methods rather than the Parse/Serialize traits.
Fields§
§name: StringThe command name, e.g. "connect", "createStream", "publish",
"_result".
transaction_id: f64The transaction id correlating a response to its request (0 for
commands that expect no response, e.g. onStatus).
arguments: Vec<Amf0Value>The remaining AMF0 values in the command body, in wire order (conventionally: Command Object, then any further arguments).
Implementations§
Source§impl Command
impl Command
Sourcepub fn parse(payload: &[u8]) -> Result<Self, RtmpError>
pub fn parse(payload: &[u8]) -> Result<Self, RtmpError>
Parse a Command Message body: AMF0 String (name) + AMF0 Number
(transaction_id) + the remaining AMF0 values (arguments), read
until payload is exhausted.
§Errors
RtmpError::Malformed if the first value is not a String or the
second is not a Number; RtmpError::BufferTooShort /
RtmpError::Unsupported propagated from Amf0Value::parse.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Command
Available on crate feature serde only.
impl<'de> Deserialize<'de> for Command
serde only.