File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -43,4 +43,8 @@ impl<'treeseq> LLTree<'treeseq> {
4343 pub fn as_ptr ( & mut self ) -> * const tsk_tree_t {
4444 self . inner . as_ptr ( )
4545 }
46+
47+ pub fn as_ref ( & self ) -> & tsk_tree_t {
48+ self . inner . as_ref ( )
49+ }
4650}
Original file line number Diff line number Diff line change @@ -19,10 +19,7 @@ impl<'treeseq> Tree<'treeseq> {
1919 ) -> Result < Self , TskitError > {
2020 let flags = flags. into ( ) ;
2121 let inner = LLTree :: new ( ts, flags) ?;
22- Ok ( Self {
23- inner,
24- advanced : 0 ,
25- } )
22+ Ok ( Self { inner, advanced : 0 } )
2623 }
2724
2825 pub ( crate ) fn new_at_position < F : Into < TreeFlags > , P : Into < Position > > (
@@ -56,6 +53,14 @@ impl<'treeseq> Tree<'treeseq> {
5653 } ;
5754 Ok ( tree)
5855 }
56+
57+ /// Return the `[left, right)` coordinates of the tree.
58+ pub fn interval ( & self ) -> ( Position , Position ) {
59+ (
60+ self . inner . as_ref ( ) . interval . left . into ( ) ,
61+ self . inner . as_ref ( ) . interval . right . into ( ) ,
62+ )
63+ }
5964}
6065
6166impl < ' ts > streaming_iterator:: StreamingIterator for Tree < ' ts > {
You can’t perform that action at this time.
0 commit comments