pub enum AtValue {
String(String),
Integer(u32),
Range((u32, u32)),
Unknown(String),
Empty,
BracketedArray(Vec<AtValue>),
Array(Vec<AtValue>),
}Expand description
Any of a set of types used in AT commands.
Variants§
String(String)
A string-type value - text surrounded by “quotation marks”.
Integer(u32)
An integer.
Range((u32, u32))
A range of integers.
Unknown(String)
Some untyped value - usually ‘bareword’ strings, i.e. strings that aren’t surrounded in “quotation marks”.
Empty
An empty value, corresponding to nothing at all.
BracketedArray(Vec<AtValue>)
A bracketed array.
Array(Vec<AtValue>)
A non-bracketed array.
Implementations§
Source§impl AtValue
§enum Variant Predicates
impl AtValue
§enum Variant Predicates
Sourcepub fn is_integer(&self) -> bool
pub fn is_integer(&self) -> bool
Is this AtValue a Integer?
Sourcepub fn is_unknown(&self) -> bool
pub fn is_unknown(&self) -> bool
Is this AtValue a Unknown?
Sourcepub fn is_bracketed_array(&self) -> bool
pub fn is_bracketed_array(&self) -> bool
Is this AtValue a BracketedArray?
Source§impl AtValue
This impl block provides methods to extract various types
out of an AtValue. If the value is not of the desired type,
HuaweiError::TypeMismatch is returned.
impl AtValue
This impl block provides methods to extract various types
out of an AtValue. If the value is not of the desired type,
HuaweiError::TypeMismatch is returned.
as_xmethods takeself, and return either the type or an error.get_xmethods take&self, and return a&reference.get_x_mutmethods take&mut self, and return a&mutreference.
pub fn get_string(&self) -> HuaweiResult<&String>
pub fn get_string_mut(&mut self) -> HuaweiResult<&mut String>
pub fn as_string(self) -> HuaweiResult<String>
pub fn get_integer(&self) -> HuaweiResult<&u32>
pub fn get_integer_mut(&mut self) -> HuaweiResult<&mut u32>
pub fn as_integer(self) -> HuaweiResult<u32>
pub fn get_range(&self) -> HuaweiResult<&(u32, u32)>
pub fn get_range_mut(&mut self) -> HuaweiResult<&mut (u32, u32)>
pub fn as_range(self) -> HuaweiResult<(u32, u32)>
pub fn get_unknown(&self) -> HuaweiResult<&String>
pub fn get_unknown_mut(&mut self) -> HuaweiResult<&mut String>
pub fn as_unknown(self) -> HuaweiResult<String>
pub fn get_bracketed_array(&self) -> HuaweiResult<&Vec<AtValue>>
pub fn get_bracketed_array_mut(&mut self) -> HuaweiResult<&mut Vec<AtValue>>
pub fn as_bracketed_array(self) -> HuaweiResult<Vec<AtValue>>
pub fn get_array(&self) -> HuaweiResult<&Vec<AtValue>>
pub fn get_array_mut(&mut self) -> HuaweiResult<&mut Vec<AtValue>>
pub fn as_array(self) -> HuaweiResult<Vec<AtValue>>
Trait Implementations§
Source§impl Display for AtValue
Writes the AtValue out, as it would appear on the command line.
impl Display for AtValue
Writes the AtValue out, as it would appear on the command line.
This impl is directly used for formatting AtValues when making
AT commands.
impl Eq for AtValue
impl StructuralPartialEq for AtValue
Auto Trait Implementations§
impl Freeze for AtValue
impl RefUnwindSafe for AtValue
impl Send for AtValue
impl Sync for AtValue
impl Unpin for AtValue
impl UnwindSafe for AtValue
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