Struct tskit::MigrationTable
source · [−]pub struct MigrationTable<'a> { /* private fields */ }
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
sourceimpl<'a> MigrationTable<'a>
impl<'a> MigrationTable<'a>
sourcepub fn left<M: Into<MigrationId> + Copy>(
&'a self,
row: M
) -> Result<Position, TskitError>
pub fn left<M: Into<MigrationId> + Copy>(
&'a self,
row: M
) -> Result<Position, TskitError>
sourcepub fn right<M: Into<MigrationId> + Copy>(
&'a self,
row: M
) -> Result<Position, TskitError>
pub fn right<M: Into<MigrationId> + Copy>(
&'a self,
row: M
) -> Result<Position, TskitError>
sourcepub fn node<M: Into<MigrationId> + Copy>(
&'a self,
row: M
) -> Result<NodeId, TskitError>
pub fn node<M: Into<MigrationId> + Copy>(
&'a self,
row: M
) -> Result<NodeId, TskitError>
sourcepub 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>
sourcepub 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.
sourcepub fn time<M: Into<MigrationId> + Copy>(
&'a self,
row: M
) -> Result<Time, TskitError>
pub fn time<M: Into<MigrationId> + Copy>(
&'a self,
row: M
) -> Result<Time, TskitError>
Return the time of the migration event for a given row.
Errors
TskitError::IndexError
ifrow
is out of range.
sourcepub 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>
sourcepub fn iter(&self) -> impl Iterator<Item = MigrationTableRow> + '_
pub fn iter(&self) -> impl Iterator<Item = MigrationTableRow> + '_
Return an iterator over rows of the table.
The value of the iterator is MigrationTableRow
.
sourcepub fn row<M: Into<MigrationId> + Copy>(
&self,
r: M
) -> Result<MigrationTableRow, TskitError>
pub fn row<M: Into<MigrationId> + Copy>(
&self,
r: M
) -> Result<MigrationTableRow, TskitError>
Return row r
of the table.
Parameters
r
: the row id.
Errors
TskitError::IndexError
if r
is out of range.
Auto Trait Implementations
impl<'a> RefUnwindSafe for MigrationTable<'a>
impl<'a> !Send for MigrationTable<'a>
impl<'a> !Sync for MigrationTable<'a>
impl<'a> Unpin for MigrationTable<'a>
impl<'a> UnwindSafe for MigrationTable<'a>
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