#[repr(transparent)]
pub struct ProvenanceTable { /* private fields */ }
Available on crate feature provenance only.
Expand description

An immutable view of a provenance table.

These are not created directly. to get a reference to an existing provenance table;

Notes

  • The type is enabled by the "provenance" feature.

Implementations§

source§

impl ProvenanceTable

source

pub fn num_rows(&self) -> SizeType

Return the number of rows

source

pub fn timestamp<P: Into<ProvenanceId> + Copy>(&self, row: P) -> Option<&str>

Get the ISO-formatted time stamp for row row.

Returns
  • Some(String) if row is valid.
  • None otherwise.
Examples

let mut tables = tskit::TableCollection::new(10.).unwrap();
assert!(tables.add_provenance("foo").is_ok());
if let Some(timestamp) = tables.provenances().timestamp(0) {
 // then 0 is a valid row in the provenance table
}
source

pub fn record<P: Into<ProvenanceId> + Copy>(&self, row: P) -> Option<&str>

Get the provenance record for row row.

Returns
  • Some(String) if row is valid.
  • None otherwise.
Examples

let mut tables = tskit::TableCollection::new(10.).unwrap();
assert!(tables.add_provenance("foo").is_ok());
if let Some(record) = tables.provenances().record(0) {
 // then 0 is a valid row in the provenance table
}
source

pub fn row<P: Into<ProvenanceId> + Copy>( &self, row: P ) -> Option<ProvenanceTableRow>

Obtain a ProvenanceTableRow for row row.

Returns
  • Some(row) if r is valid
  • None otherwise
source

pub fn row_view<P: Into<ProvenanceId> + Copy>( &self, row: P ) -> Option<ProvenanceTableRowView<'_>>

Obtain a ProvenanceTableRowView for row row.

Returns
  • Some(row view) if r is valid
  • None otherwise
source

pub fn iter(&self) -> impl Iterator<Item = ProvenanceTableRow> + '_

Return an iterator over rows of the table. The value of the iterator is ProvenanceTableRow.

source

pub fn lending_iter(&self) -> ProvenanceTableRowView<'_>

Trait Implementations§

source§

impl Debug for ProvenanceTable

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> Free for T

source§

unsafe default fn free(ptr_ref: NonNull<T>)

Drops the content pointed by this pointer and frees it. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.