pub struct Binary { /* private fields */ }
Expand description
Binary representation of the regulatory Database
Implementations§
Source§impl Binary
impl Binary
Sourcepub fn from_regdb(regdb: &RegDB) -> Result<Self>
pub fn from_regdb(regdb: &RegDB) -> Result<Self>
Create a Binary representation of the Regulatory DB
§Arguments
regdb
- reference of a regulatory database
Examples found in repository?
examples/generate-regdb.rs (line 17)
4fn main() {
5 if args().len() != 3 {
6 eprintln!("Usage: {} input-file output-file", args().nth(0).unwrap());
7 std::process::exit(-1);
8 }
9
10 let in_file = args().nth(1).unwrap();
11 let out_file = args().nth(2).unwrap();
12
13 let lexer = TokType::parse(in_file).unwrap();
14
15 let db = RegDB::from_lexer(lexer).unwrap();
16
17 let bin_db = Binary::from_regdb(&db).unwrap();
18
19 bin_db.write_file(out_file).unwrap();
20}
Sourcepub fn write_file<P: AsRef<Path>>(&self, path: P) -> Result<()>
pub fn write_file<P: AsRef<Path>>(&self, path: P) -> Result<()>
Examples found in repository?
examples/generate-regdb.rs (line 19)
4fn main() {
5 if args().len() != 3 {
6 eprintln!("Usage: {} input-file output-file", args().nth(0).unwrap());
7 std::process::exit(-1);
8 }
9
10 let in_file = args().nth(1).unwrap();
11 let out_file = args().nth(2).unwrap();
12
13 let lexer = TokType::parse(in_file).unwrap();
14
15 let db = RegDB::from_lexer(lexer).unwrap();
16
17 let bin_db = Binary::from_regdb(&db).unwrap();
18
19 bin_db.write_file(out_file).unwrap();
20}
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Binary
impl RefUnwindSafe for Binary
impl Send for Binary
impl Sync for Binary
impl Unpin for Binary
impl UnwindSafe for Binary
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more