Struct tskit::provenance::ProvenanceTable
source · 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
sourceimpl ProvenanceTable
impl ProvenanceTable
sourcepub fn timestamp<P: Into<ProvenanceId> + Copy>(&self, row: P) -> Option<String>
pub fn timestamp<P: Into<ProvenanceId> + Copy>(&self, row: P) -> Option<String>
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<String>
pub fn record<P: Into<ProvenanceId> + Copy>(&self, row: P) -> Option<String>
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 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
.
Auto Trait Implementations
impl RefUnwindSafe for ProvenanceTable
impl !Send for ProvenanceTable
impl !Sync for ProvenanceTable
impl Unpin for ProvenanceTable
impl UnwindSafe for ProvenanceTable
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