Crate tskit[][src]

A rust interface to tskit.

This crate provides a mapping of the tskit C API to rust. The result is an interface similar to the tskit Python interface, but with all operations implemented using compiled code.

Features

Interface to the C library

Safety

  • The types listed above handle all the memory management!
  • All array accesses are range-checked.
  • Object lifetimes are clear:
    • Creating a tree sequence moves/consumes a table collection.
    • Tree lifetimes are tied to that of the parent tree sequence.
    • Table objects (NodeTable, etc..) are only represented by non-owning, immutable types.

Optional features

Some features are optional, and are activated by requesting them in your Cargo.toml file.

To add features to your Cargo.toml file:

[dependencies]
tskit = {version = "0.2.0", features=["feature0", "feature1"]}

What is missing?

  • A lot of wrappers to the C functions.
  • Tree sequence statistics!

Re-exports

pub use bindings::TSK_NODE_IS_SAMPLE;
pub use bindings::tsk_flags_t;
pub use bindings::tsk_id_t;
pub use bindings::tsk_size_t;
pub use error::TskitError;

Modules

bindings

Low-level (“unsafe”) bindings to the C API.

error

Error handling

ffi

Define traits related to wrapping tskit stuff

metadata
provenance

Optional module for table and tree sequence provenance tables.

types

“Other” tskit types live here.

Structs

EdgeTable

An immutable view of an edge table.

EdgeTableRow

Row of an EdgeTable

IndividualTable

An immutable view of a individual table.

IndividualTableRow

Row of a IndividualTable

MigrationTable

An immutable view of a migration table.

MigrationTableRow

Row of a MigrationTable

MutationTable

An immutable view of site table.

MutationTableRow

Row of a MutationTable

NodeTable

An immtable view of a node table.

NodeTableRow

Row of a NodeTable

PopulationTable

An immutable view of site table.

PopulationTableRow

Row of a PopulationTable

SimplificationOptions

Control the behavior of crate::TableCollection::simplify and crate::TreeSequence::simplify

SiteTable

An immutable view of site table.

SiteTableRow

Row of a SiteTable

TableClearOptions

Modify behavior of crate::TableCollection::clear.

TableCollection

A table collection.

TableEqualityOptions

Modify behavior of crate::TableCollection::equals.

TableOutputOptions

Modify behavior of crate::TableCollection::dump.

TableSortOptions

Modify behavior of crate::TableCollection::sort.

Tree

A Tree.

TreeFlags

Specify the behavior of iterating over [Tree] objects. See [TreeSequence::tree_iterator].

TreeSequence

A tree sequence.

TreeSequenceFlags

Modify behavior of crate::TableCollection::tree_sequence and crate::TreeSequence::new.

Enums

NodeTraversalOrder

Specify the traversal order used by Tree::traverse_nodes.

Constants

TSK_NULL

“Null” identifier value.

Traits

NodeIterator

Trait defining iteration over nodes.

NodeListGenerator

Interface for returning lists of node ids from types implementing TableAccess.

TableAccess

Immutable access to tables.

TskitTypeAccess

Provide pointer access to underlying C types

Functions

c_api_major_version

C API major version

c_api_minor_version

C API minor version

c_api_patch_version

C API patch version

c_api_version

The C API version in MAJOR.MINOR.PATCH format

version

Version of the rust crate.

Type Definitions

TskReturnValue

Handles return codes from low-level tskit functions.