File tree Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Expand file tree Collapse file tree 1 file changed +26
-0
lines changed Original file line number Diff line number Diff line change 15
15
use crate :: bindings as ll_bindings;
16
16
use crate :: SizeType ;
17
17
use crate :: { tsk_id_t, tsk_size_t, ProvenanceId , TskitError } ;
18
+ use ll_bindings:: { tsk_provenance_table_free, tsk_provenance_table_init} ;
18
19
19
20
#[ derive( Eq ) ]
20
21
/// Row of a [`ProvenanceTable`].
@@ -177,6 +178,31 @@ impl<'a> ProvenanceTable<'a> {
177
178
}
178
179
}
179
180
181
+ build_owned_table_type ! (
182
+ /// A provenance table that owns its own data.
183
+ ///
184
+ /// # Examples
185
+ ///
186
+ /// ```rust
187
+ /// # #[cfg(any(doc, feature = "provenance"))] {
188
+ /// use tskit::provenance::OwnedProvenanceTable;
189
+ /// let mut provenances = OwnedProvenanceTable::default();
190
+ /// let id = provenances.add_row("message").unwrap();
191
+ /// assert_eq!(id, 0);
192
+ /// assert_eq!(provenances.num_rows(), 1);
193
+ /// # }
194
+ /// ```
195
+ => OwnedProvenanceTable ,
196
+ ProvenanceTable ,
197
+ tsk_provenance_table_t,
198
+ tsk_provenance_table_init,
199
+ tsk_provenance_table_free
200
+ ) ;
201
+
202
+ impl OwnedProvenanceTable {
203
+ provenance_table_add_row ! ( => add_row, self , * self . table) ;
204
+ }
205
+
180
206
#[ cfg( test) ]
181
207
mod test_provenances {
182
208
use super :: * ;
You can’t perform that action at this time.
0 commit comments