Struct tskit::MigrationTable [−][src]
pub struct MigrationTable<'a> { /* fields omitted */ }
Expand description
An immutable view of a migration table.
These are not created directly.
Instead, use TableCollection::migrations
to get a reference to an existing node table;
Implementations
Return the number of rows
pub fn source<M: Into<MigrationId> + Copy>(
&'a self,
row: M
) -> Result<PopulationId, TskitError>
pub fn source<M: Into<MigrationId> + Copy>(
&'a self,
row: M
) -> Result<PopulationId, TskitError>
pub fn dest<M: Into<MigrationId> + Copy>(
&'a self,
row: M
) -> Result<PopulationId, TskitError>
pub fn dest<M: Into<MigrationId> + Copy>(
&'a self,
row: M
) -> Result<PopulationId, TskitError>
Return the destination population for a given row.
Errors
TskitError::IndexError
ifrow
is out of range.
Return the time of the migration event for a given row.
Errors
TskitError::IndexError
ifrow
is out of range.
pub fn metadata<T: MetadataRoundtrip>(
&'a self,
row: MigrationId
) -> Result<Option<T>, TskitError>
pub fn metadata<T: MetadataRoundtrip>(
&'a self,
row: MigrationId
) -> Result<Option<T>, TskitError>
Return an iterator over rows of the table.
The value of the iterator is MigrationTableRow
.
Return row r
of the table.
Parameters
r
: the row id.
Errors
TskitError::IndexError
if r
is out of range.