pub struct DemeSize(/* private fields */);
Expand description
The size of a Deme
at a given Time
.
This is a newtype wrapper for f64
.
§Notes
- The size may take on non-integer values.
§Examples
§In a YAML
record
let yaml = "
time_units: years
generation_time: 25
description:
A deme of 50 individuals that grew to 100 individuals
in the last 100 years.
demes:
- name: deme
epochs:
- start_size: 50
end_time: 100
- start_size: 50
end_size: 100
";
demes::loads(yaml).unwrap();
§Using rust code
let t = demes::DemeSize::try_from(50.0).unwrap();
assert_eq!(t, 50.0);
Trait Implementations§
source§impl<'de> Deserialize<'de> for DemeSize
impl<'de> Deserialize<'de> for DemeSize
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 Ord for DemeSize
impl Ord for DemeSize
source§impl PartialEq<DemeSize> for f64
impl PartialEq<DemeSize> for f64
source§impl PartialEq for DemeSize
impl PartialEq for DemeSize
source§impl PartialOrd<DemeSize> for f64
impl PartialOrd<DemeSize> for f64
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl PartialOrd<f64> for DemeSize
impl PartialOrd<f64> for DemeSize
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl PartialOrd for DemeSize
impl PartialOrd for DemeSize
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl TryFrom<InputDemeSize> for DemeSize
impl TryFrom<InputDemeSize> for DemeSize
§type Error = DemesError
type Error = DemesError
The type returned in the event of a conversion error.
impl Copy for DemeSize
impl Eq for DemeSize
Auto Trait Implementations§
impl Freeze for DemeSize
impl RefUnwindSafe for DemeSize
impl Send for DemeSize
impl Sync for DemeSize
impl Unpin for DemeSize
impl UnwindSafe for DemeSize
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 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.