pub struct PopulationTable { /* private fields */ }Expand description
An immutable view of site table.
Implementations§
Source§impl 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))ifrowis valid and decoding succeeded.Some(Err(_))ifrowis not valid and decoding failed.Noneifrowis not valid.
§Errors
TskitError::MetadataErrorif 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.
pub fn lending_iter(&self) -> PopulationTableRowView<'_>
Sourcepub fn row<P: Into<PopulationId> + Copy>(
&self,
r: P,
) -> Option<PopulationTableRow>
pub fn row<P: Into<PopulationId> + Copy>( &self, r: P, ) -> Option<PopulationTableRow>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PopulationTable
impl RefUnwindSafe for PopulationTable
impl !Send for PopulationTable
impl !Sync for PopulationTable
impl Unpin for PopulationTable
impl UnwindSafe for PopulationTable
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more