pub struct AtResponsePacket {
pub responses: Vec<AtResponse>,
pub status: AtResultCode,
}Expand description
The complete set of responses to an issued AT command.
Fields§
§responses: Vec<AtResponse>The various AtResponses issued.
Note that this will only contain ‘expected’ InformationResponses,
as well as any Unknown responses. ‘Expected’ values are values
that were expected as a result of the command issued - for more
information, see the AtCommand documentation.
status: AtResultCodeThe final result code for this command.
Implementations§
Source§impl AtResponsePacket
impl AtResponsePacket
Sourcepub fn extract_named_response_opt(
&self,
resp: &str,
) -> HuaweiResult<Option<&AtValue>>
pub fn extract_named_response_opt( &self, resp: &str, ) -> HuaweiResult<Option<&AtValue>>
Extracts the value of an InformationResponse that has a given resp
as its param, if such a response exists.
Also invokes self.assert_ok()?, to verify that the response was successful.
Sourcepub fn extract_named_response(&self, resp: &str) -> HuaweiResult<&AtValue>
pub fn extract_named_response(&self, resp: &str) -> HuaweiResult<&AtValue>
Like extract_named_response_opt, but fails with a HuaweiError::ExpectedResponse if the
named response doesn’t actually exist.
Sourcepub fn assert_ok(&self) -> HuaweiResult<()>
pub fn assert_ok(&self) -> HuaweiResult<()>
Returns HuaweiError::AtError(self.status.clone()) if the status code was not Ok.
Trait Implementations§
Source§impl Clone for AtResponsePacket
impl Clone for AtResponsePacket
Source§fn clone(&self) -> AtResponsePacket
fn clone(&self) -> AtResponsePacket
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for AtResponsePacket
impl RefUnwindSafe for AtResponsePacket
impl Send for AtResponsePacket
impl Sync for AtResponsePacket
impl Unpin for AtResponsePacket
impl UnwindSafe for AtResponsePacket
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