pub struct Data { /* private fields */ }
Expand description
A byte buffer used for serialization to and from the plist data type.
You use it in types with derived Serialize
/Deserialize
traits.
Examples
extern crate plist;
#[macro_use]
extern crate serde_derive;
#[derive(Deserialize, Serialize)]
struct Info {
blob: plist::Data,
}
let actual = Info { blob: plist::Data::new(vec![1, 2, 3, 4]) };
let mut xml_byte_buffer: Vec<u8> = vec![];
plist::to_writer_xml(&mut xml_byte_buffer, &actual)
.expect("serialize into xml");
let expected: Info = plist::from_reader_xml(xml_byte_buffer.as_slice())
.expect("deserialize from xml");
assert_eq!(actual.blob, expected.blob);
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Data
impl<'de> Deserialize<'de> for Data
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 PartialEq<Data> for Data
impl PartialEq<Data> for Data
impl Eq for Data
impl StructuralEq for Data
impl StructuralPartialEq for Data
Auto Trait Implementations§
impl RefUnwindSafe for Data
impl Send for Data
impl Sync for Data
impl Unpin for Data
impl UnwindSafe for Data
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.