[][src]Enum plist::Value

pub enum Value {
    Array(Vec<Value>),
    Dictionary(BTreeMap<String, Value>),
    Boolean(bool),
    Data(Vec<u8>),
    Date(Date),
    Real(f64),
    Integer(i64),
    String(String),
}

Represents any plist value.

Variants

Array(Vec<Value>)Dictionary(BTreeMap<String, Value>)Boolean(bool)Data(Vec<u8>)Date(Date)Real(f64)Integer(i64)String(String)

Methods

impl Value[src]

pub fn from_file<P: AsRef<Path>>(path: P) -> Result<Value, Error>[src]

Reads a Value from a plist file of any encoding.

pub fn from_reader<R: Read + Seek>(reader: R) -> Result<Value, Error>[src]

Reads a Value from a seekable byte stream containing a plist file of any encoding.

pub fn from_reader_xml<R: Read>(reader: R) -> Result<Value, Error>[src]

Reads a Value from a seekable byte stream containing an XML encoded plist file.

pub fn to_writer_xml<W: Write>(&self, writer: W) -> Result<(), Error>[src]

Serializes the given data structure as an XML encoded plist file.

pub fn from_events<T>(events: T) -> Result<Value, Error> where
    T: IntoIterator<Item = Result<Event, Error>>, 
[src]

Creates a Value from an event source.

pub fn into_events(self) -> Vec<Event>[src]

Converts a Value into an Event stream.

pub fn as_array(&self) -> Option<&Vec<Value>>[src]

If the Value is an Array, returns the associated Vec.

Returns None otherwise.

pub fn as_array_mut(&mut self) -> Option<&mut Vec<Value>>[src]

If the Value is an Array, returns the associated mutable Vec.

Returns None otherwise.

pub fn as_dictionary(&self) -> Option<&BTreeMap<String, Value>>[src]

If the Value is a Dictionary, returns the associated BTreeMap.

Returns None otherwise.

pub fn as_dictionary_mut(&mut self) -> Option<&mut BTreeMap<String, Value>>[src]

If the Value is a Dictionary, returns the associated mutable BTreeMap.

Returns None otherwise.

pub fn as_boolean(&self) -> Option<bool>[src]

If the Value is a Boolean, returns the associated bool.

Returns None otherwise.

pub fn into_data(self) -> Option<Vec<u8>>[src]

If the Value is a Data, returns the underlying Vec.

Returns None otherwise.

This method consumes the Value. If this is not desired, please use as_data method.

pub fn as_data(&self) -> Option<&[u8]>[src]

If the Value is a Data, returns the associated Vec.

Returns None otherwise.

pub fn as_date(&self) -> Option<Date>[src]

If the Value is a Date, returns the associated Date.

Returns None otherwise.

pub fn as_real(&self) -> Option<f64>[src]

If the Value is a Real, returns the associated f64.

Returns None otherwise.

pub fn as_integer(&self) -> Option<i64>[src]

If the Value is an Integer, returns the associated i64.

Returns None otherwise.

pub fn into_string(self) -> Option<String>[src]

If the Value is a String, returns the underlying String.

Returns None otherwise.

This method consumes the Value. If this is not desired, please use as_string method.

pub fn as_string(&self) -> Option<&str>[src]

If the Value is a String, returns the associated str.

Returns None otherwise.

Trait Implementations

impl PartialEq<Value> for Value[src]

impl Clone for Value[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl From<Vec<Value>> for Value[src]

impl From<BTreeMap<String, Value>> for Value[src]

impl From<bool> for Value[src]

impl<'a> From<&'a bool> for Value[src]

impl From<Date> for Value[src]

impl<'a> From<&'a Date> for Value[src]

impl From<f64> for Value[src]

impl From<f32> for Value[src]

impl From<i64> for Value[src]

impl From<i32> for Value[src]

impl From<i16> for Value[src]

impl From<i8> for Value[src]

impl From<u32> for Value[src]

impl From<u16> for Value[src]

impl From<u8> for Value[src]

impl<'a> From<&'a f64> for Value[src]

impl<'a> From<&'a f32> for Value[src]

impl<'a> From<&'a i64> for Value[src]

impl<'a> From<&'a i32> for Value[src]

impl<'a> From<&'a i16> for Value[src]

impl<'a> From<&'a i8> for Value[src]

impl<'a> From<&'a u32> for Value[src]

impl<'a> From<&'a u16> for Value[src]

impl<'a> From<&'a u8> for Value[src]

impl From<String> for Value[src]

impl<'a> From<&'a str> for Value[src]

impl Debug for Value[src]

Auto Trait Implementations

impl Send for Value

impl Sync for Value

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]