Enum amf::amf3::Value
[−]
[src]
pub enum Value { 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>>, }, }
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
Undefined
See 3.2 undefined Type.
Null
See 3.3 null Type.
Boolean(bool)
See 3.4 false Type and 3.5 true Type.
Integer(i32)
See 3.6 integer Type.
Double(f64)
See 3.7 double Type.
String(String)
See 3.8 String Type.
XmlDocument(String)
See 3.9 XMLDocument Type.
Date
See 3.10 Date Type.
Fields
unix_time: Duration | Unix timestamp with milliseconds precision. |
Array
See 3.11 Array Type.
Fields
assoc_entries: Vec<Pair<String, Value>> | Entries of the associative part of the array. |
dense_entries: Vec<Value> | Entries of the dense part of the array. |
Object
See 3.12 Object Type.
Fields
class_name: Option<String> | The class name of the object.
|
sealed_count: usize | Sealed member count of the object. Sealed members are located in front of the |
entries: Vec<Pair<String, Value>> | Members of the object. |
Xml(String)
See 3.13 XML Type.
ByteArray(Vec<u8>)
See 3.14 ByteArray Type.
IntVector
See 3.15 Vector Type.
Fields
is_fixed: bool | If |
entries: Vec<i32> | The entries of the vector. |
UintVector
See 3.15 Vector Type.
Fields
is_fixed: bool | If |
entries: Vec<u32> | The entries of the vector. |
DoubleVector
See 3.15 Vector Type.
Fields
is_fixed: bool | If |
entries: Vec<f64> | The entries of the vector. |
ObjectVector
See 3.15 Vector Type.
Fields
class_name: Option<String> | The base type name of entries in the vector.
|
is_fixed: bool | If |
entries: Vec<Value> | The entries of the vector. |
Dictionary
See 3.16 Dictionary Type.
Fields
is_weak: bool | If |
entries: Vec<Pair<Value, Value>> | The entries of the dictionary. |
Methods
impl Value
[src]
fn read_from<R>(reader: R) -> DecodeResult<Self> where R: Read
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).
fn write_to<W>(&self, writer: W) -> Result<()> where W: Write
Writes the AMF3 encoded bytes of this value to writer
.
Trait Implementations
impl Debug for Value
[src]
impl Clone for Value
[src]
fn clone(&self) -> Value
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl PartialEq for Value
[src]
fn eq(&self, __arg_0: &Value) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Value) -> bool
This method tests for !=
.
impl PartialOrd for Value
[src]
fn partial_cmp(&self, __arg_0: &Value) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &Value) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &Value) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &Value) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &Value) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more