pub enum Format {
Xml,
Binary,
Ascii,
}Expand description
The encodings of property lists.
Deserialization detects the format automatically, the serializer
writes the format of its SerializerConfig.
Variants§
Xml
The XML format (<plist version="1.0">).
This is the default when serializing.
Binary
The binary format (bplist00).
Ascii
The OpenStep format, also known as ASCII or old-style property lists
({ key = value; }).
Xcode project files (.pbxproj) and .strings files use it. The
format has no types besides strings, dictionaries, arrays and data.
Implementations§
Source§impl Format
impl Format
Sourcepub fn detect(input: &[u8]) -> Format
pub fn detect(input: &[u8]) -> Format
Detects the format of a property list.
Binary property lists start with bplist, XML documents with a
markup declaration or an element. Everything else is treated as
OpenStep. Byte order marks are skipped.
use deser_plist::Format;
assert_eq!(Format::detect(b"bplist00..."), Format::Binary);
assert_eq!(Format::detect(b"<?xml version=\"1.0\"?>"), Format::Xml);
assert_eq!(Format::detect(b"<plist><true/></plist>"), Format::Xml);
assert_eq!(Format::detect(b"{ a = b; }"), Format::Ascii);
assert_eq!(Format::detect(b"<0fbd7a>"), Format::Ascii);Trait Implementations§
impl Copy for Format
impl Eq for Format
impl StructuralPartialEq for Format
Auto Trait Implementations§
impl Freeze for Format
impl RefUnwindSafe for Format
impl Send for Format
impl Sync for Format
impl Unpin for Format
impl UnsafeUnpin for Format
impl UnwindSafe for Format
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