pub enum Plist {
Dictionary(BTreeMap<SmolStr, Plist>),
Array(Vec<Plist>),
String(String),
Integer(i64),
Float(OrderedFloat<f64>),
Data(Vec<u8>),
}Expand description
An enum representing a property list.
Variants§
Dictionary(BTreeMap<SmolStr, Plist>)
Array(Vec<Plist>)
String(String)
Integer(i64)
Float(OrderedFloat<f64>)
Data(Vec<u8>)
Implementations§
Source§impl Plist
impl Plist
pub fn parse(s: &str) -> Result<Plist, Error>
pub fn get(&self, key: &str) -> Option<&Plist>
pub fn as_dict(&self) -> Option<&BTreeMap<SmolStr, Plist>>
pub fn as_array(&self) -> Option<&[Plist]>
pub fn as_str(&self) -> Option<&str>
pub fn as_i64(&self) -> Option<i64>
pub fn as_f64(&self) -> Option<f64>
pub fn expect_dict(self) -> Result<BTreeMap<SmolStr, Plist>, Error>
pub fn expect_array(self) -> Result<Vec<Plist>, Error>
pub fn expect_string(self) -> Result<String, Error>
pub fn expect_data(self) -> Result<Vec<u8>, Error>
pub fn to_string(&self) -> String
Trait Implementations§
impl Eq for Plist
impl StructuralPartialEq for Plist
Auto Trait Implementations§
impl Freeze for Plist
impl RefUnwindSafe for Plist
impl Send for Plist
impl Sync for Plist
impl Unpin for Plist
impl UnwindSafe for Plist
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
Source§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
Convert this type into
T, using the provided data to resolve any offsets.