Macro lu_packets::amf3
source · [−]macro_rules! amf3 {
{} => { ... };
($($name:literal:$value:expr),+ $(,)?) => { ... };
($value:expr; $n:expr) => { ... };
($($value:expr),+ $(,)?) => { ... };
}Expand description
Creates an Amf3::Array containing the arguments.
Since AMF3 arrays are both vectors and maps at the same time, there are multiple forms of the macro, for map and for vector usage.
Map usage
The syntax is name: value, where name is a string literal that will be converted to an Amf3String, and value is an expression that will be converted to an Amf3 object.
Example:
amf3! {
"false": false,
"true": true,
"double1": 3.14f32,
"double2": 3.14f64,
"string": "string",
"array": amf3! { "inner": "array"},
};Vector usage
The syntax is the exact same as with the vec! macro, except that the arguments will be converted to an Amf3 object before being inserted.
Example:
amf3! [true, false, true];
amf3! [true; 4];