Enum amf::amf3::Value [−][src]
pub enum Value {
Show 17 variants
Undefined,
Null,
Boolean(bool),
Integer(i32),
Double(f64),
String(String),
XmlDocument(String),
Date {
unix_time: Duration,
},
Array {
assoc_entries: Vec<Pair<String, Value>>,
dense_entries: Vec<Value>,
},
Object {
class_name: Option<String>,
sealed_count: usize,
entries: Vec<Pair<String, Value>>,
},
Xml(String),
ByteArray(Vec<u8>),
IntVector {
is_fixed: bool,
entries: Vec<i32>,
},
UintVector {
is_fixed: bool,
entries: Vec<u32>,
},
DoubleVector {
is_fixed: bool,
entries: Vec<f64>,
},
ObjectVector {
class_name: Option<String>,
is_fixed: bool,
entries: Vec<Value>,
},
Dictionary {
is_weak: bool,
entries: Vec<Pair<Value, Value>>,
},
}
Expand description
AMF3 value.
Examples
use amf::amf3::Value;
// Encodes a AMF3's integer
let integer = Value::from(Value::Integer(123));
let mut buf = Vec::new();
integer.write_to(&mut buf).unwrap();
// Decodes above integer
let decoded = Value::read_from(&mut &buf[..]).unwrap();
assert_eq!(integer, decoded);
Variants
See [3.2 undefined Type] (https://www.adobe.com/content/dam/acom/en/devnet/pdf/amf-file-format-spec.pdf#page=6&zoom=auto,88,264).
See [3.3 null Type] (https://www.adobe.com/content/dam/acom/en/devnet/pdf/amf-file-format-spec.pdf#page=6&zoom=auto,88,139).
Boolean(bool)
See [3.4 false Type] (https://www.adobe.com/content/dam/acom/en/devnet/pdf/amf-file-format-spec.pdf#page=7&zoom=auto,88,694) and [3.5 true Type] (https://www.adobe.com/content/dam/acom/en/devnet/pdf/amf-file-format-spec.pdf#page=7&zoom=auto,88,596).
Tuple Fields of Boolean
0: bool
Integer(i32)
See [3.6 integer Type] (https://www.adobe.com/content/dam/acom/en/devnet/pdf/amf-file-format-spec.pdf#page=7&zoom=auto,88,499).
Tuple Fields of Integer
0: i32
Double(f64)
See [3.7 double Type] (https://www.adobe.com/content/dam/acom/en/devnet/pdf/amf-file-format-spec.pdf#page=7&zoom=auto,88,321).
Tuple Fields of Double
0: f64
String(String)
See [3.8 String Type] (https://www.adobe.com/content/dam/acom/en/devnet/pdf/amf-file-format-spec.pdf#page=7&zoom=auto,88,196).
Tuple Fields of String
0: String
XmlDocument(String)
See [3.9 XMLDocument Type] (https://www.adobe.com/content/dam/acom/en/devnet/pdf/amf-file-format-spec.pdf#page=8&zoom=auto,88,639).
Tuple Fields of XmlDocument
0: String
See [3.10 Date Type] (https://www.adobe.com/content/dam/acom/en/devnet/pdf/amf-file-format-spec.pdf#page=8&zoom=auto,88,316).
Fields of Date
unix_time: Duration
Unix timestamp with milliseconds precision.
See [3.11 Array Type] (https://www.adobe.com/content/dam/acom/en/devnet/pdf/amf-file-format-spec.pdf#page=9&zoom=auto,88,720).
Fields of Array
See [3.12 Object Type] (https://www.adobe.com/content/dam/acom/en/devnet/pdf/amf-file-format-spec.pdf#page=9&zoom=auto,88,275).
Fields of Object
Xml(String)
See [3.13 XML Type] (https://www.adobe.com/content/dam/acom/en/devnet/pdf/amf-file-format-spec.pdf#page=11&zoom=auto,88,360).
Tuple Fields of Xml
0: String
See [3.14 ByteArray Type] (https://www.adobe.com/content/dam/acom/en/devnet/pdf/amf-file-format-spec.pdf#page=11&zoom=auto,88,167).
See [3.15 Vector Type] (https://www.adobe.com/content/dam/acom/en/devnet/pdf/amf-file-format-spec.pdf#page=12&zoom=auto,88,534).
Fields of IntVector
See [3.15 Vector Type] (https://www.adobe.com/content/dam/acom/en/devnet/pdf/amf-file-format-spec.pdf#page=12&zoom=auto,88,534).
Fields of UintVector
See [3.15 Vector Type] (https://www.adobe.com/content/dam/acom/en/devnet/pdf/amf-file-format-spec.pdf#page=12&zoom=auto,88,534).
Fields of DoubleVector
See [3.15 Vector Type] (https://www.adobe.com/content/dam/acom/en/devnet/pdf/amf-file-format-spec.pdf#page=12&zoom=auto,88,534).
Fields of ObjectVector
See [3.16 Dictionary Type] (https://www.adobe.com/content/dam/acom/en/devnet/pdf/amf-file-format-spec.pdf#page=13&zoom=auto,88,601).
Fields of Dictionary
Implementations
Reads an AMF3 encoded Value
from reader
.
Note that reference objects are copied in the decoding phase for the sake of simplicity of the resulting value representation. And circular reference are unsupported (i.e., those are treated as errors).
Writes the AMF3 encoded bytes of this value to writer
.
Tries to convert the value as a str
reference.
Tries to convert the value as a f64
.
Tries to convert the value as an iterator of the contained values.
Trait Implementations
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for Value
impl UnwindSafe for Value
Blanket Implementations
Mutably borrows from an owned value. Read more