pub struct Metadata { /* private fields */ }
Expand description
Top-level metadata
Examples
#[derive(serde::Deserialize)]
struct MyMetaData {
foo: i32,
bar: String
}
let yaml = "
time_units: generations
metadata:
foo: 1
bar: bananas
demes:
- name: A
epochs:
- start_size: 100
";
let graph = demes::loads(yaml).unwrap();
let yaml_metadata = graph.metadata().unwrap().as_yaml_string().unwrap();
let my_metadata: MyMetaData = serde_yaml::from_str(&yaml_metadata).unwrap();
assert_eq!(my_metadata.foo, 1);
assert_eq!(&my_metadata.bar, "bananas");
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for Metadata
impl<'de> Deserialize<'de> for Metadata
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<Metadata> for Metadata
impl PartialEq<Metadata> for Metadata
impl Eq for Metadata
impl StructuralEq for Metadata
impl StructuralPartialEq for Metadata
Auto Trait Implementations§
impl RefUnwindSafe for Metadata
impl Send for Metadata
impl Sync for Metadata
impl Unpin for Metadata
impl UnwindSafe for Metadata
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<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.