Trait tskit::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
fn mutations(&self) -> MutationTable<'_>
fn mutations(&self) -> MutationTable<'_>
Get reference to the MutationTable
.
fn populations(&self) -> PopulationTable<'_>
fn populations(&self) -> PopulationTable<'_>
Get reference to the PopulationTable
.
fn migrations(&self) -> MigrationTable<'_>
fn migrations(&self) -> MigrationTable<'_>
Get reference to the MigrationTable
.
fn individuals(&self) -> IndividualTable<'_>
fn individuals(&self) -> IndividualTable<'_>
Get reference to the IndividualTable
.
Provided methods
fn edges_iter(&self) -> TableIterator<EdgeTable<'_>>
fn edges_iter(&self) -> TableIterator<EdgeTable<'_>>
Return an iterator over the edges.
See EdgeTable::iter
for details.
fn nodes_iter(&self) -> TableIterator<NodeTable<'_>>
fn nodes_iter(&self) -> TableIterator<NodeTable<'_>>
Return an iterator over the nodes.
See NodeTable::iter
for details.
fn mutations_iter(&self) -> TableIterator<MutationTable<'_>>
fn mutations_iter(&self) -> TableIterator<MutationTable<'_>>
Return an iterator over the mutations.
See MutationTable::iter
for details.
fn sites_iter(&self) -> TableIterator<SiteTable<'_>>
fn sites_iter(&self) -> TableIterator<SiteTable<'_>>
Return an iterator over the sites.
See SiteTable::iter
for details.
fn populations_iter(&self) -> TableIterator<PopulationTable<'_>>
fn populations_iter(&self) -> TableIterator<PopulationTable<'_>>
Return an iterator over the populations.
See PopulationTable::iter
for details.
fn migrations_iter(&self) -> TableIterator<MigrationTable<'_>>
fn migrations_iter(&self) -> TableIterator<MigrationTable<'_>>
Return an iterator over the migration events.
See MigrationTable::iter
for details.
fn individuals_iter(&self) -> TableIterator<IndividualTable<'_>>
fn individuals_iter(&self) -> TableIterator<IndividualTable<'_>>
Return an iterator over the individuals.
See IndividualTable::iter
for details.