Trait tskit::prelude::TableAccess[][src]

pub trait TableAccess {
Show 14 methods fn edges(&self) -> EdgeTable<'_>;
fn nodes(&self) -> NodeTable<'_>;
fn mutations(&self) -> MutationTable<'_>;
fn sites(&self) -> SiteTable<'_>;
fn populations(&self) -> PopulationTable<'_>;
fn migrations(&self) -> MigrationTable<'_>;
fn individuals(&self) -> IndividualTable<'_>; fn edges_iter(&self) -> TableIterator<EdgeTable<'_>> { ... }
fn nodes_iter(&self) -> TableIterator<NodeTable<'_>> { ... }
fn mutations_iter(&self) -> TableIterator<MutationTable<'_>> { ... }
fn sites_iter(&self) -> TableIterator<SiteTable<'_>> { ... }
fn populations_iter(&self) -> TableIterator<PopulationTable<'_>> { ... }
fn migrations_iter(&self) -> TableIterator<MigrationTable<'_>> { ... }
fn individuals_iter(&self) -> TableIterator<IndividualTable<'_>> { ... }
}
Expand description

Immutable access to tables.

For objects that contain the full suite of tables, implementing this trait provides immutable access to their data.

For most types, the provided implementations of _iter methods should do.

Examples

use tskit::TableAccess;

let mut tables = tskit::TableCollection::new(1.).unwrap();
// The borrows are immuatble, so we can
// take multiple table references from the same object.
let e = tables.edges();
let n = tables.nodes();

The borrow checker will keep you from getting in trouble:

use tskit::TableAccess;

let mut tables = tskit::TableCollection::new(1.).unwrap();
let e = tables.edges();
tables.add_edge(0.0, 1.0, 0, 1).unwrap();
let p = e.parent(0).unwrap();   // FAIL!

Required methods

Get reference to the EdgeTable.

Get reference to the NodeTable.

Get reference to the MutationTable.

Get reference to the SiteTable.

Get reference to the PopulationTable.

Get reference to the MigrationTable.

Get reference to the IndividualTable.

Provided methods

Return an iterator over the edges. See EdgeTable::iter for details.

Return an iterator over the nodes. See NodeTable::iter for details.

Return an iterator over the mutations. See MutationTable::iter for details.

Return an iterator over the sites. See SiteTable::iter for details.

Return an iterator over the populations. See PopulationTable::iter for details.

Return an iterator over the migration events. See MigrationTable::iter for details.

Return an iterator over the individuals. See IndividualTable::iter for details.

Implementors