[−][src]Enum amf::amf3::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
See [3.2 undefined Type] (http://download.macromedia.com/pub/labs/amf/amf3_spec_121207.pdf#page=6&zoom=auto,88,264).
See [3.3 null Type] (http://download.macromedia.com/pub/labs/amf/amf3_spec_121207.pdf#page=6&zoom=auto,88,139).
Boolean(bool)
See [3.4 false Type] (http://download.macromedia.com/pub/labs/amf/amf3_spec_121207.pdf#page=7&zoom=auto,88,694) and [3.5 true Type] (http://download.macromedia.com/pub/labs/amf/amf3_spec_121207.pdf#page=7&zoom=auto,88,596).
Integer(i32)
See [3.6 integer Type] (http://download.macromedia.com/pub/labs/amf/amf3_spec_121207.pdf#page=7&zoom=auto,88,499).
Double(f64)
See [3.7 double Type] (http://download.macromedia.com/pub/labs/amf/amf3_spec_121207.pdf#page=7&zoom=auto,88,321).
String(String)
See [3.8 String Type] (http://download.macromedia.com/pub/labs/amf/amf3_spec_121207.pdf#page=7&zoom=auto,88,196).
XmlDocument(String)
See [3.9 XMLDocument Type] (http://download.macromedia.com/pub/labs/amf/amf3_spec_121207.pdf#page=8&zoom=auto,88,639).
See [3.10 Date Type] (http://download.macromedia.com/pub/labs/amf/amf3_spec_121207.pdf#page=8&zoom=auto,88,316).
Fields of Date
unix_time: Duration
Unix timestamp with milliseconds precision.
See [3.11 Array Type] (http://download.macromedia.com/pub/labs/amf/amf3_spec_121207.pdf#page=9&zoom=auto,88,720).
Fields of Array
See [3.12 Object Type] (http://download.macromedia.com/pub/labs/amf/amf3_spec_121207.pdf#page=9&zoom=auto,88,275).
Fields of Object
Xml(String)
See [3.13 XML Type] (http://download.macromedia.com/pub/labs/amf/amf3_spec_121207.pdf#page=11&zoom=auto,88,360).
See [3.14 ByteArray Type] (http://download.macromedia.com/pub/labs/amf/amf3_spec_121207.pdf#page=11&zoom=auto,88,167).
See [3.15 Vector Type] (http://download.macromedia.com/pub/labs/amf/amf3_spec_121207.pdf#page=12&zoom=auto,88,534).
Fields of IntVector
See [3.15 Vector Type] (http://download.macromedia.com/pub/labs/amf/amf3_spec_121207.pdf#page=12&zoom=auto,88,534).
Fields of UintVector
See [3.15 Vector Type] (http://download.macromedia.com/pub/labs/amf/amf3_spec_121207.pdf#page=12&zoom=auto,88,534).
Fields of DoubleVector
See [3.15 Vector Type] (http://download.macromedia.com/pub/labs/amf/amf3_spec_121207.pdf#page=12&zoom=auto,88,534).
Fields of ObjectVector
See [3.16 Dictionary Type] (http://download.macromedia.com/pub/labs/amf/amf3_spec_121207.pdf#page=13&zoom=auto,88,601).
Fields of Dictionary
Methods
impl Value
[src]
pub fn read_from<R>(reader: R) -> DecodeResult<Self> where
R: Read,
[src]
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).
pub fn write_to<W>(&self, writer: W) -> Result<()> where
W: Write,
[src]
W: Write,
Writes the AMF3 encoded bytes of this value to writer
.
pub fn try_as_str(&self) -> Option<&str>
[src]
Tries to convert the value as a str
reference.
pub fn try_as_f64(&self) -> Option<f64>
[src]
Tries to convert the value as a f64
.
pub fn try_into_values(self) -> Result<Box<dyn Iterator<Item = Value>>, Self>
[src]
Tries to convert the value as an iterator of the contained values.
pub fn try_into_pairs(
self
) -> Result<Box<dyn Iterator<Item = (String, Value)>>, Self>
[src]
self
) -> Result<Box<dyn Iterator<Item = (String, Value)>>, Self>
Tries to convert the value as an iterator of the contained pairs.
Trait Implementations
impl Clone for Value
[src]
impl Debug for Value
[src]
impl From<Value> for Value
[src]
impl PartialEq<Value> for Value
[src]
impl PartialOrd<Value> for Value
[src]
fn partial_cmp(&self, other: &Value) -> Option<Ordering>
[src]
fn lt(&self, other: &Value) -> bool
[src]
fn le(&self, other: &Value) -> bool
[src]
fn gt(&self, other: &Value) -> bool
[src]
fn ge(&self, other: &Value) -> bool
[src]
impl StructuralPartialEq for Value
[src]
Auto Trait Implementations
impl RefUnwindSafe for Value
impl Send for Value
impl Sync for Value
impl Unpin for Value
impl UnwindSafe for Value
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,