causal_hub/io/bif/mod.rs
1mod parser;
2pub use parser::BifParser;
3
4/// A trait for reading and writing BIF files.
5pub trait BifIO {
6 /// Create an instance of the type from a BIF string.
7 ///
8 /// # Arguments
9 ///
10 /// * `bif` - A string slice that holds the BIF data.
11 ///
12 /// # Returns
13 ///
14 /// A new instance of the type.
15 ///
16 fn from_bif(bif: &str) -> Self;
17
18 /// Convert the instance to a BIF string.
19 ///
20 /// # Returns
21 ///
22 /// A string slice that holds the BIF data.
23 ///
24 fn to_bif(&self) -> String;
25
26 /// Read a BIF file and create an instance of the type.
27 ///
28 /// # Arguments
29 ///
30 /// * `path` - A string slice that holds the path to the BIF file.
31 ///
32 /// # Returns
33 ///
34 /// A new instance of the type.
35 ///
36 fn read_bif(path: &str) -> Self;
37
38 /// Write the instance to a BIF file.
39 ///
40 /// # Arguments
41 ///
42 /// * `path` - A string slice that holds the path to the BIF file.
43 ///
44 fn write_bif(&self, path: &str);
45}