Enum amf::amf0::Value [−][src]
pub enum Value {
Number(f64),
Boolean(bool),
String(String),
Object {
class_name: Option<String>,
entries: Vec<Pair<String, Value>>,
},
Null,
Undefined,
EcmaArray {
entries: Vec<Pair<String, Value>>,
},
Array {
entries: Vec<Value>,
},
Date {
unix_time: Duration,
time_zone: i16,
},
XmlDocument(String),
AvmPlus(Value),
}
Expand description
AMF0 value.
Examples
use amf::amf0::Value;
// Encodes a AMF3's number
let number = Value::from(Value::Number(12.3));
let mut buf = Vec::new();
number.write_to(&mut buf).unwrap();
// Decodes above number
let decoded = Value::read_from(&mut &buf[..]).unwrap();
assert_eq!(number, decoded);
Variants
Number(f64)
See [2.2 Number Type] (http://download.macromedia.com/pub/labs/amf/amf0_spec_121207.pdf#page=5&zoom=auto,90,667).
Tuple Fields of Number
0: f64
Boolean(bool)
See [2.3 Boolean Type] (http://download.macromedia.com/pub/labs/amf/amf0_spec_121207.pdf#page=5&zoom=auto,90,569).
Tuple Fields of Boolean
0: bool
String(String)
See [2.4 String Type] (http://download.macromedia.com/pub/labs/amf/amf0_spec_121207.pdf#page=5&zoom=auto,90,432) and [2.14 Long String Type] (http://download.macromedia.com/pub/labs/amf/amf0_spec_121207.pdf#page=7&zoom=auto,90,360).
Tuple Fields of String
0: String
See [2.5 Object Type] (http://download.macromedia.com/pub/labs/amf/amf0_spec_121207.pdf#page=5&zoom=auto,90,320) and [2.18 Typed Object Type] (http://download.macromedia.com/pub/labs/amf/amf0_spec_121207.pdf#page=8&zoom=auto,90,682).
Fields of Object
See [2.7 null Type] (http://download.macromedia.com/pub/labs/amf/amf0_spec_121207.pdf#page=6&zoom=auto,90,720).
See [2.8 undefined Type] (http://download.macromedia.com/pub/labs/amf/amf0_spec_121207.pdf#page=6&zoom=auto,90,637).
See [2.10 ECMA Array Type] (http://download.macromedia.com/pub/labs/amf/amf0_spec_121207.pdf#page=6&zoom=auto,90,349).
[2.12 Strict Array Type] (http://download.macromedia.com/pub/labs/amf/amf0_spec_121207.pdf#page=7&zoom=auto,90,684)
See [2.13 Date Type] (http://download.macromedia.com/pub/labs/amf/amf0_spec_121207.pdf#page=7&zoom=auto,90,546).
Fields of Date
XmlDocument(String)
See [2.17 XML Document Type] (http://download.macromedia.com/pub/labs/amf/amf0_spec_121207.pdf#page=7&zoom=auto,90,147).
Tuple Fields of XmlDocument
0: String
AvmPlus(Value)
See [3.1 AVM+ Type Marker] (http://download.macromedia.com/pub/labs/amf/amf0_spec_121207.pdf#page=8&zoom=auto,90,518).
Tuple Fields of AvmPlus
0: Value
Implementations
Reads an AMF0 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 AMF0 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