pub enum Plist {
Dictionary(Dictionary),
Array(Array),
String(String),
Integer(i64),
Float(f64),
Data(Vec<u8>),
}Expand description
An enum representing a property list.
Variants§
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 flatten_to_integer(&self) -> Plist
pub fn flatten_to_string(&self) -> Plist
pub fn expect_dict(self) -> Result<Dictionary, Error>
pub fn expect_array(self) -> Result<Array, Error>
pub fn expect_string(self) -> Result<String, Error>
pub fn expect_data(self) -> Result<Vec<u8>, Error>
pub fn to_string(&self) -> String
pub fn is_meaningful(&self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Plist
impl<'de> Deserialize<'de> for Plist
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<BTreeMap<SmolStr, Plist>> for Plist
impl From<BTreeMap<SmolStr, Plist>> for Plist
Source§fn from(x: Dictionary) -> Plist
fn from(x: Dictionary) -> Plist
Converts to this type from the input type.
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§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)