RegDB

Struct RegDB 

Source
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

Source

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§

Source§

impl Debug for RegDB

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for RegDB

Source§

fn default() -> RegDB

Returns the “default value” for a type. Read more
Source§

impl PartialEq for RegDB

Source§

fn eq(&self, other: &RegDB) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for RegDB

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.