pub struct Graph { /* private fields */ }
Expand description
A resolved demes Graph.
Instances of this type will be fully-resolved according to the machine data model described here.
A graph cannot be directly initialized. See:
Implementations
sourceimpl Graph
impl Graph
sourcepub fn get_deme_from_name(&self, name: &str) -> Option<&Deme>
pub fn get_deme_from_name(&self, name: &str) -> Option<&Deme>
sourcepub fn generation_time(&self) -> Option<GenerationTime>
pub fn generation_time(&self) -> Option<GenerationTime>
Get the GenerationTime
for the graph.
sourcepub fn time_units(&self) -> TimeUnits
pub fn time_units(&self) -> TimeUnits
Get the TimeUnits
for the graph.
sourcepub fn migrations(&self) -> &[AsymmetricMigration]
pub fn migrations(&self) -> &[AsymmetricMigration]
Get the migration events for the graph.
sourcepub fn to_generations(self) -> Result<Self, DemesError>
pub fn to_generations(self) -> Result<Self, DemesError>
Convert the time units to generations.
Errors
If the time unit of an event differs sufficiently in
magnitude from the generation_time
, it is possible
that conversion results in epochs (or migration
durations) of length zero, which will return an error.
If any field is unresolved, an error will be returned.
sourcepub fn to_integer_generations(
self,
round: RoundTimeToInteger
) -> Result<Graph, DemesError>
pub fn to_integer_generations(
self,
round: RoundTimeToInteger
) -> Result<Graph, DemesError>
Convert the time units to generations, rounding the output to an integer value.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Graph
impl<'de> Deserialize<'de> for Graph
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
impl Eq for Graph
Auto Trait Implementations
impl !RefUnwindSafe for Graph
impl !Send for Graph
impl !Sync for Graph
impl Unpin for Graph
impl !UnwindSafe for Graph
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.