pub struct SiteTable { /* private fields */ }Expand description
An immutable view of site table.
Implementations§
Source§impl SiteTable
impl SiteTable
Sourcepub fn position<S: Into<SiteId> + Copy>(&self, row: S) -> Option<Position>
pub fn position<S: Into<SiteId> + Copy>(&self, row: S) -> Option<Position>
Return the position value from row row of the table.
§Returns
Some(position)ifrowis valid.Noneotherwise.
Sourcepub fn ancestral_state<S: Into<SiteId>>(&self, row: S) -> Option<&[u8]>
pub fn ancestral_state<S: Into<SiteId>>(&self, row: S) -> Option<&[u8]>
Get the ancestral_state value from row row of the table.
§Returns
Some(ancestral state)ifrowis valid.Noneotherwise.
Sourcepub fn metadata<T: SiteMetadata>(
&self,
row: SiteId,
) -> Option<Result<T, TskitError>>
pub fn metadata<T: SiteMetadata>( &self, row: SiteId, ) -> 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 = SiteTableRow> + '_
pub fn iter(&self) -> impl Iterator<Item = SiteTableRow> + '_
Return an iterator over rows of the table.
The value of the iterator is SiteTableRow.
pub fn lending_iter(&self) -> SiteTableRowView<'_>
Sourcepub fn position_slice(&self) -> &[Position]
pub fn position_slice(&self) -> &[Position]
Get the position column as a slice
Sourcepub fn position_slice_raw(&self) -> &[f64]
pub fn position_slice_raw(&self) -> &[f64]
Get the position column as a slice
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SiteTable
impl RefUnwindSafe for SiteTable
impl !Send for SiteTable
impl !Sync for SiteTable
impl Unpin for SiteTable
impl UnwindSafe for SiteTable
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