pub struct SiteTable { /* 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 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)
ifrow
is valid.None
otherwise.
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)
ifrow
is valid.None
otherwise.
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))
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 = SiteTableRow> + '_
pub fn iter(&self) -> impl Iterator<Item = SiteTableRow> + '_
Return an iterator over rows of the table.
The value of the iterator is SiteTableRow
.
Auto Trait Implementations
impl RefUnwindSafe for SiteTable
impl !Send for SiteTable
impl !Sync for SiteTable
impl Unpin for SiteTable
impl UnwindSafe for SiteTable
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