#[repr(transparent)]pub struct DemeSize(_);
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
Normally, one only needs to create a DemeSize
when
working with GraphBuilder
.
let t = demes::DemeSize::from(50.0);
assert_eq!(t, 50.0);
Trait Implementations
sourceimpl<'de> Deserialize<'de> for DemeSize
impl<'de> Deserialize<'de> for DemeSize
sourcefn 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
sourceimpl Ord for DemeSize
impl Ord for DemeSize
sourceimpl PartialOrd<DemeSize> for DemeSize
impl PartialOrd<DemeSize> for DemeSize
sourcefn partial_cmp(&self, other: &Self) -> Option<Ordering>
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl PartialOrd<DemeSize> for f64
impl PartialOrd<DemeSize> for f64
sourcefn partial_cmp(&self, other: &DemeSize) -> Option<Ordering>
fn partial_cmp(&self, other: &DemeSize) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
sourceimpl PartialOrd<f64> for DemeSize
impl PartialOrd<f64> for DemeSize
sourcefn partial_cmp(&self, other: &f64) -> Option<Ordering>
fn partial_cmp(&self, other: &f64) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn 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 more
impl Copy for DemeSize
impl Eq for DemeSize
Auto Trait Implementations
impl RefUnwindSafe for DemeSize
impl Send for DemeSize
impl Sync for DemeSize
impl Unpin for DemeSize
impl UnwindSafe for DemeSize
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.