pub struct Parsed<C> {
pub cmd: C,
pub no: bool,
pub vals: Vec<(String, Val)>,
}Expand description
a parsed command line
Fields§
§cmd: C§no: boolthe line started with “no”
vals: Vec<(String, Val)>the keywords and parameters in order, by key
Implementations§
Source§impl<C> Parsed<C>
impl<C> Parsed<C>
Sourcepub fn get(&self, key: &str) -> Option<&Val>
pub fn get(&self, key: &str) -> Option<&Val>
the value of a key; a later one hides an earlier one (“name WORD=name” gives the word, “ping X repeat 5 repeat 7” the 7)
pub fn num(&self, key: &str) -> Option<i64>
pub fn ip(&self, key: &str) -> Option<[u8; 4]>
pub fn prefix(&self, key: &str) -> Option<([u8; 4], u8)>
pub fn mac(&self, key: &str) -> Option<[u8; 6]>
pub fn ip6(&self, key: &str) -> Option<[u8; 16]>
Trait Implementations§
impl<C: Eq> Eq for Parsed<C>
impl<C: PartialEq> StructuralPartialEq for Parsed<C>
Auto Trait Implementations§
impl<C> Forget for Parsed<C>
impl<C> Freeze for Parsed<C>where
C: Freeze,
impl<C> RefUnwindSafe for Parsed<C>where
C: RefUnwindSafe,
impl<C> Send for Parsed<C>where
C: Send,
impl<C> Sync for Parsed<C>where
C: Sync,
impl<C> Unpin for Parsed<C>where
C: Unpin,
impl<C> UnsafeUnpin for Parsed<C>where
C: UnsafeUnpin,
impl<C> UnwindSafe for Parsed<C>where
C: UnwindSafe,
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