[−][src]Enum wireless_regdb::lexer::TokType
Token Representing content from the txt file format of the binary database
Variants
String(String)
String Token
Int(usize)
Integer represented as usize
Single @
Token
Implementations
impl TokType
[src]
pub fn parse<P: AsRef<Path>>(file: P) -> Result<Vec<Self>>
[src]
pub fn parse_str(db: &str) -> Result<Vec<Self>>
[src]
Parse a string to a Vec of Tokens
Arguments
db
- string of the database
Example
use wireless_regdb::TokType; let tokens = TokType::parse_str("wmmrule: ETSI").unwrap();
pub fn get_string(&self) -> Result<String>
[src]
Return the string of the token, if the token contains a string
Example
use wireless_regdb::TokType; let token = TokType::String("hello_world".to_string()); let content = token.get_string().unwrap();
pub fn get_int(&self) -> Result<usize>
[src]
Return the usize of the token, if the token contains an integer
Example
use wireless_regdb::TokType; let token = TokType::Int(1337); let content = token.get_int().unwrap();
Trait Implementations
impl Clone for TokType
[src]
impl Debug for TokType
[src]
impl Eq for TokType
[src]
impl PartialEq<TokType> for TokType
[src]
impl StructuralEq for TokType
[src]
impl StructuralPartialEq for TokType
[src]
Auto Trait Implementations
impl RefUnwindSafe for TokType
impl Send for TokType
impl Sync for TokType
impl Unpin for TokType
impl UnwindSafe for TokType
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,