Skip to main content

Value

Enum Value 

Source
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

§id: ObjectId

The unique id that will be used to refer back to this Object

§data: ObjectValue

The 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

§id: ObjectId

A unique identifier that will be used to refer back to this ECMAArray

§data: ECMAArrayObjectValue

The data within this ECMAArray

§

StrictArray

Represent a strict array (amf0) or a dense array (amf3)

Fields

§id: ObjectId

A unique identifier that will be used to refer back to this StrictArray

§values: Vec<Value>

The data within this StrictArray

§

Date

Represent a timestamp

Fields

§time: f64

Number of seconds since the epoch

§timezone_or_utc: Option<u16>

The timezone identifier or UTC if missing

§

Unsupported

Represent the unsupported type

§

XML

Represent the XML type, (value, is_string)

Fields

§value: String

The XML data

§is_string: bool

Is this XML a 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

§id: ObjectId

A unique identifier that will be used to refer back to this VectorObject

§data: VectorObjectValue

The data in this Vector

§

Dictionary

Represent the dictionary type (amf3)

Fields

§id: ObjectId

A unique identifier that will be used to refer back to this Dictionary

§data: DictionaryObjectValue

The 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

Trait Implementations§

Source§

impl Clone for Value

Source§

fn clone(&self) -> Value

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Value

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Value

Source§

fn eq(&self, other: &Value) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Value

Auto Trait Implementations§

§

impl Freeze for Value

§

impl RefUnwindSafe for Value

§

impl Send for Value

§

impl Sync for Value

§

impl Unpin for Value

§

impl UnsafeUnpin for Value

§

impl UnwindSafe for Value

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.