File tree Expand file tree Collapse file tree 4 files changed +29
-14
lines changed
Expand file tree Collapse file tree 4 files changed +29
-14
lines changed Original file line number Diff line number Diff line change 11use clap:: { value_t_or_exit, App , Arg } ;
2- use streaming_iterator :: StreamingIterator ; // Required for tree iteration
2+ use tskit :: prelude :: * ;
33
44// "Manual" traversal from samples to root
55fn traverse_upwards ( tree : & tskit:: Tree ) {
Original file line number Diff line number Diff line change 11#![ macro_use]
22
3- /// Convenience macro issuing `use` for all public traits.
4- #[ macro_export]
5- macro_rules! enable_tskit_traits {
6- ( ) => {
7- use $crate:: metadata:: MetadataRoundtrip ;
8- #[ cfg( feature = "provenance" ) ]
9- use $crate:: provenance:: Provenance ;
10- use $crate:: NodeListGenerator ;
11- use $crate:: TableAccess ;
12- use $crate:: TskitTypeAccess ;
13- } ;
14- }
15-
163#[ doc( hidden) ]
174macro_rules! handle_tsk_return_value {
185 ( $code: expr) => { {
Original file line number Diff line number Diff line change 2424//! * Tree lifetimes are tied to that of the parent tree sequence.
2525//! * Table objects ([`NodeTable`], etc..) are only represented by non-owning, immutable types.
2626//!
27+ //! ## Prelude
28+ //!
29+ //! The [`prelude`] module contains definitions that are difficult/annoying to live without.
30+ //! In particuar, this module exports various traits that make it so that client code does
31+ //! not have to `use` them a la carte.
32+ //!
33+ //! We recomment that client code import all symbols from this module:
34+ //!
35+ //! ```
36+ //! use tskit::prelude::*;
37+ //! ```
38+ //!
39+ //! The various documentation examples manually `use` each trait both in order
40+ //! to illustrate which traits are needed and to serve as doc tests.
41+ //!
2742//! # Optional features
2843//!
2944//! Some features are optional, and are activated by requesting them in your `Cargo.toml` file.
@@ -60,6 +75,7 @@ mod migration_table;
6075mod mutation_table;
6176mod node_table;
6277mod population_table;
78+ pub mod prelude;
6379mod site_table;
6480mod table_collection;
6581mod table_iterator;
Original file line number Diff line number Diff line change 1+ //! Export commonly-use types and traits
2+
3+ pub use crate :: tsk_flags_t;
4+ pub use crate :: tsk_id_t;
5+ pub use crate :: tsk_size_t;
6+ pub use crate :: NodeListGenerator ;
7+ pub use crate :: TableAccess ;
8+ pub use crate :: TskitTypeAccess ;
9+ pub use crate :: TSK_NODE_IS_SAMPLE ;
10+ pub use crate :: TSK_NULL ;
11+ pub use streaming_iterator:: DoubleEndedStreamingIterator ;
12+ pub use streaming_iterator:: StreamingIterator ;
You can’t perform that action at this time.
0 commit comments