pub struct OwnedProvenanceTable { /* private fields */ }
Available on crate feature provenance only.
Expand description

A provenance table that owns its own data.

Examples

{
use tskit::provenance::OwnedProvenanceTable;
let mut provenances = OwnedProvenanceTable::default();
let id = provenances.add_row("message").unwrap();
assert_eq!(id, 0);
assert_eq!(provenances.num_rows(), 1);

Implementations

Methods from Deref<Target = ProvenanceTable>

Return the number of rows

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
}

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
}

Obtain a ProvenanceTableRow for row row.

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

Obtain a ProvenanceTableRowView for row row.

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

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

Trait Implementations

Returns the “default value” for a type. Read more
The resulting type after dereferencing.
Dereferences the value.
Mutably dereferences the value.
Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Drops the content pointed by this pointer and frees it. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.