Struct tskit::PopulationTable
source · #[repr(transparent)]pub struct PopulationTable { /* private fields */ }
Expand description
An immutable view of site table.
These are not created directly but are accessed
by types implementing std::ops::Deref
to
crate::table_views::TableViews
Implementations
sourceimpl PopulationTable
impl PopulationTable
sourcepub fn metadata<T: PopulationMetadata>(
&self,
row: PopulationId
) -> Option<Result<T, TskitError>>
pub fn metadata<T: PopulationMetadata>(
&self,
row: PopulationId
) -> Option<Result<T, TskitError>>
Retrieve decoded metadata for a row
.
Returns
Some(Ok(T))
ifrow
is valid and decoding succeeded.Some(Err(_))
ifrow
is not valid and decoding failed.None
ifrow
is not valid.
Errors
TskitError::MetadataError
if decoding fails.
Examples.
The big-picture semantics are the same for all table types.
See crate::IndividualTable::metadata
for examples.
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
) -> Option<PopulationTableRow>
pub fn row<P: Into<PopulationId> + Copy>(
&self,
r: P
) -> Option<PopulationTableRow>
Auto Trait Implementations
impl RefUnwindSafe for PopulationTable
impl !Send for PopulationTable
impl !Sync for PopulationTable
impl Unpin for PopulationTable
impl UnwindSafe for PopulationTable
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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