pub struct SiteTable<'a> { /* private fields */ }
Expand description
An immutable view of site table.
These are not created directly.
Instead, use TableAccess::sites
to get a reference to an existing site table;
Implementations
sourceimpl<'a> SiteTable<'a>
impl<'a> SiteTable<'a>
sourcepub fn position<S: Into<SiteId> + Copy>(
&'a self,
row: S
) -> Result<Position, TskitError>
pub fn position<S: Into<SiteId> + Copy>(
&'a self,
row: S
) -> Result<Position, TskitError>
Return the position
value from row row
of the table.
Errors
Will return IndexError
if row
is out of range.
sourcepub fn ancestral_state<S: Into<SiteId>>(
&'a self,
row: S
) -> Result<Option<&'_ [u8]>, TskitError>
pub fn ancestral_state<S: Into<SiteId>>(
&'a self,
row: S
) -> Result<Option<&'_ [u8]>, TskitError>
Get the ancestral_state
value from row row
of the table.
Return
Will return None
if there is no ancestral state.
Errors
Will return IndexError
if row
is out of range.
pub fn metadata<T: MetadataRoundtrip>(
&'a self,
row: SiteId
) -> Result<Option<T>, TskitError>
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
.
sourcepub fn row<S: Into<SiteId> + Copy>(
&self,
r: S
) -> Result<SiteTableRow, TskitError>
pub fn row<S: Into<SiteId> + Copy>(
&self,
r: S
) -> Result<SiteTableRow, 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 SiteTable<'a>
impl<'a> !Send for SiteTable<'a>
impl<'a> !Sync for SiteTable<'a>
impl<'a> Unpin for SiteTable<'a>
impl<'a> UnwindSafe for SiteTable<'a>
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