pub enum Value {
Show 22 variants
Number(f64),
Bool(bool),
String(String),
Object {
id: ObjectId,
data: ObjectValue,
},
Null,
Undefined,
ECMAArray {
id: ObjectId,
data: ECMAArrayObjectValue,
},
StrictArray {
id: ObjectId,
values: Vec<Value>,
},
Date {
time: f64,
timezone_or_utc: Option<u16>,
},
Unsupported,
XML {
value: String,
is_string: bool,
},
AMF3(Box<Value>),
Integer(i32),
ByteArray(Vec<u8>),
VectorInt(VectorPrimitiveValue<i32>),
VectorUInt(VectorPrimitiveValue<u32>),
VectorDouble(VectorPrimitiveValue<f64>),
VectorObject {
id: ObjectId,
data: VectorObjectValue,
},
Dictionary {
id: ObjectId,
data: DictionaryObjectValue,
},
Custom(CustomObjectValue),
Reference(Reference),
Amf3ObjectReference(ObjectId),
}Expand description
A single or compound value
Variants§
Number(f64)
Represent the type number (amf0) and double (amf3)
Bool(bool)
Represents the type boolean (amf0) and both the true/false type (amf3)
String(String)
Represent both the string (amf0/3) and long string type (amf0)
Object
Represents the object type in both amf0 and amf3, class definition are only available with amf3
Fields
data: ObjectValueThe data within this value
Null
Represent the null type
Undefined
Represent the undefined type
ECMAArray
Represent ECMA-Arrays (amf0) and associative arrays (amf3, even if they contain a dense part)
Fields
data: ECMAArrayObjectValueThe data within this ECMAArray
StrictArray
Represent a strict array (amf0) or a dense array (amf3)
Fields
Date
Represent a timestamp
Fields
Unsupported
Represent the unsupported type
XML
Represent the XML type, (value, is_string)
AMF3(Box<Value>)
Represent an amf3 element embedded in an AMF0 file
Integer(i32)
Represent the integer type (u29) (amf3)
ByteArray(Vec<u8>)
Represent the bytearray type (amf3)
VectorInt(VectorPrimitiveValue<i32>)
Represent the int vector type (amf3)
VectorUInt(VectorPrimitiveValue<u32>)
Represent the unsigned int vector type (amf3)
VectorDouble(VectorPrimitiveValue<f64>)
Represent the double vector type (amf3)
VectorObject
Represent the object vector type (amf3)
Fields
data: VectorObjectValueThe data in this Vector
Dictionary
Represent the dictionary type (amf3)
Fields
data: DictionaryObjectValueThe data contained within this Dictionary
Custom(CustomObjectValue)
Represent an external object, such as from flex (custom_elements, regular elements, class def)
Reference(Reference)
Represent an existing value, stored by reference, the value here should be considered opaque
Amf3ObjectReference(ObjectId)
A reference to a previously parsed element
While traversing the graph of Value instances you should maintain a mapping of ObjectId to your internal
representation of a value and consider this a reference to the exact same value.
As Value graphs can contain cycles which are best handled by garbage collected structures
we leave the handling of this to the user, sorry