Trait tskit::TableAccess
source · [−]pub trait TableAccess {
Show 16 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 provenances(&self) -> ProvenanceTable<'_>;
fn edges_iter(&self) -> Box<dyn Iterator<Item = EdgeTableRow>> { ... }
fn nodes_iter(&self) -> Box<dyn Iterator<Item = NodeTableRow>> { ... }
fn mutations_iter(&self) -> Box<dyn Iterator<Item = MutationTableRow>> { ... }
fn sites_iter(&self) -> Box<dyn Iterator<Item = SiteTableRow>> { ... }
fn populations_iter(&self) -> Box<dyn Iterator<Item = PopulationTableRow>> { ... }
fn migrations_iter(&self) -> Box<dyn Iterator<Item = MigrationTableRow>> { ... }
fn individuals_iter(&self) -> Box<dyn Iterator<Item = IndividualTableRow>> { ... }
fn provenances_iter(&self) -> Box<dyn Iterator<Item = ProvenanceTableRow>> { ... }
}
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
.
fn provenances(&self) -> ProvenanceTable<'_>
fn provenances(&self) -> ProvenanceTable<'_>
Get reference to the ProvenanceTable
Provided Methods
fn edges_iter(&self) -> Box<dyn Iterator<Item = EdgeTableRow>>
fn edges_iter(&self) -> Box<dyn Iterator<Item = EdgeTableRow>>
Return an iterator over the edges.
fn nodes_iter(&self) -> Box<dyn Iterator<Item = NodeTableRow>>
fn nodes_iter(&self) -> Box<dyn Iterator<Item = NodeTableRow>>
Return an iterator over the nodes.
fn mutations_iter(&self) -> Box<dyn Iterator<Item = MutationTableRow>>
fn mutations_iter(&self) -> Box<dyn Iterator<Item = MutationTableRow>>
Return an iterator over the mutations.
fn sites_iter(&self) -> Box<dyn Iterator<Item = SiteTableRow>>
fn sites_iter(&self) -> Box<dyn Iterator<Item = SiteTableRow>>
Return an iterator over the sites.
fn populations_iter(&self) -> Box<dyn Iterator<Item = PopulationTableRow>>
fn populations_iter(&self) -> Box<dyn Iterator<Item = PopulationTableRow>>
Return an iterator over the populations.
fn migrations_iter(&self) -> Box<dyn Iterator<Item = MigrationTableRow>>
fn migrations_iter(&self) -> Box<dyn Iterator<Item = MigrationTableRow>>
Return an iterator over the migration events.
fn individuals_iter(&self) -> Box<dyn Iterator<Item = IndividualTableRow>>
fn individuals_iter(&self) -> Box<dyn Iterator<Item = IndividualTableRow>>
Return an iterator over the individuals.
fn provenances_iter(&self) -> Box<dyn Iterator<Item = ProvenanceTableRow>>
fn provenances_iter(&self) -> Box<dyn Iterator<Item = ProvenanceTableRow>>
Return an iterator over provenances