#[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
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
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>
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 moresourceimpl 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>
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 moresourceimpl 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>
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 moreimpl 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 Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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 Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
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.