Struct tskit::provenance::ProvenanceTable
source · #[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
impl ProvenanceTable
sourcepub fn timestamp<P: Into<ProvenanceId> + Copy>(&self, row: P) -> Option<&str>
pub fn timestamp<P: Into<ProvenanceId> + Copy>(&self, row: P) -> Option<&str>
Get the ISO-formatted time stamp for row row
.
Returns
Some(String)
ifrow
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
}
sourcepub fn record<P: Into<ProvenanceId> + Copy>(&self, row: P) -> Option<&str>
pub fn record<P: Into<ProvenanceId> + Copy>(&self, row: P) -> Option<&str>
Get the provenance record for row row
.
Returns
Some(String)
ifrow
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
}
sourcepub fn row<P: Into<ProvenanceId> + Copy>(
&self,
row: P
) -> Option<ProvenanceTableRow>
pub fn row<P: Into<ProvenanceId> + Copy>( &self, row: P ) -> Option<ProvenanceTableRow>
sourcepub fn row_view<P: Into<ProvenanceId> + Copy>(
&self,
row: P
) -> Option<ProvenanceTableRowView<'_>>
pub fn row_view<P: Into<ProvenanceId> + Copy>( &self, row: P ) -> Option<ProvenanceTableRowView<'_>>
sourcepub fn iter(&self) -> impl Iterator<Item = ProvenanceTableRow> + '_
pub fn iter(&self) -> impl Iterator<Item = ProvenanceTableRow> + '_
Return an iterator over rows of the table.
The value of the iterator is ProvenanceTableRow
.