Struct huawei_modem::at::AtResponsePacket
source · 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’ InformationResponse
s,
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: AtResultCode
The 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 copy 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 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