pub struct RegDB {
pub wmm_rules: HashMap<String, WmmRule>,
pub countries: HashMap<String, Country>,
}Expand description
The regulatory database with wmmrules and countries
Fields§
§wmm_rules: HashMap<String, WmmRule>Regulatory rules for regions.
ETSI for example
countries: HashMap<String, Country>Contries in the database. The key usese the 2 digit alpha representation
Implementations§
Source§impl RegDB
impl RegDB
Sourcepub fn from_lexer(lexer: Vec<TokType>) -> Result<Self>
pub fn from_lexer(lexer: Vec<TokType>) -> Result<Self>
Create a regulatory database from a TokenStream(Vec<lexer::TokType>)
§Arguments
lexer- Vector of tokens representing the database txt format
Examples found in repository?
examples/generate-regdb.rs (line 15)
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§
impl Eq for RegDB
impl StructuralPartialEq for RegDB
Auto Trait Implementations§
impl Freeze for RegDB
impl RefUnwindSafe for RegDB
impl Send for RegDB
impl Sync for RegDB
impl Unpin for RegDB
impl UnwindSafe for RegDB
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