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

The number of Deme instances in the graph.

Obtain a reference to a Deme by its name.

Returns

Some(&Deme) if name exists, None otherwise.

Examples

See here.

Get the Deme at index at.

Get the Deme at index at.

Details

Returns None if at is out of range.

Get the Deme instances via a slice.

Get the GenerationTime for the graph.

Get the TimeUnits for the graph.

Get the migration events for the graph.

Get the pulse events for the graph.

Get a copy of the top-level Metadata.

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.

Convert the time units to generations, rounding the output to an integer value.

Return a representation of the graph as a string.

The format is in YAML and corresponds to the MDM representation of the data.

Error

Will return an error if serde_yaml::to_string returns an error.

Return the most recent end time of any deme in the Graph.

This function is useful to check if the most recent end time is greater than zero, meaning that the model ends at a time point ancestral to “now”.

Trait Implementations

Formats the value using the given formatter. Read more
Formats the value using the given formatter. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Compare self to key and return true if they are equal.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Converts the given value to a String. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.