Struct tskit::PopulationTable
source · [−]pub struct PopulationTable<'a> { /* private fields */ }
Expand description
An immutable view of site table.
These are not created directly.
Instead, use TableCollection::populations
to get a reference to an existing population table;
Implementations
sourceimpl<'a> PopulationTable<'a>
impl<'a> PopulationTable<'a>
pub fn metadata<T: MetadataRoundtrip>(
&'a self,
row: PopulationId
) -> Result<Option<T>, TskitError>
sourcepub fn iter(&self) -> impl Iterator<Item = PopulationTableRow> + '_
pub fn iter(&self) -> impl Iterator<Item = PopulationTableRow> + '_
Return an iterator over rows of the table.
The value of the iterator is PopulationTableRow
.
sourcepub fn row<P: Into<PopulationId> + Copy>(
&self,
r: P
) -> Result<PopulationTableRow, TskitError>
pub fn row<P: Into<PopulationId> + Copy>(
&self,
r: P
) -> Result<PopulationTableRow, 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 PopulationTable<'a>
impl<'a> !Send for PopulationTable<'a>
impl<'a> !Sync for PopulationTable<'a>
impl<'a> Unpin for PopulationTable<'a>
impl<'a> UnwindSafe for PopulationTable<'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