Struct sbp::messages::flash::msg_flash_done::MsgFlashDone
source · pub struct MsgFlashDone {
pub sender_id: Option<u16>,
pub response: u8,
}
Expand description
Flash response message (host <= device)
This message defines success or failure codes for a variety of flash memory requests from the host to the device. Flash read and write messages, such as MSG_FLASH_READ_REQ, or MSG_FLASH_PROGRAM, may return this message on failure.
Fields§
§sender_id: Option<u16>
The message sender_id
response: u8
Response flags
Implementations§
source§impl MsgFlashDone
impl MsgFlashDone
sourcepub fn response_code(&self) -> Result<ResponseCode, u8>
pub fn response_code(&self) -> Result<ResponseCode, u8>
Gets the ResponseCode stored in the response
bitfield.
Returns Ok
if the bitrange contains a known ResponseCode
variant.
Otherwise the value of the bitrange is returned as an Err(u8)
. This may be because of a malformed message,
or because new variants of ResponseCode
were added.
sourcepub fn set_response_code(&mut self, response_code: ResponseCode)
pub fn set_response_code(&mut self, response_code: ResponseCode)
Set the bitrange corresponding to the ResponseCode of the response
bitfield.
Trait Implementations§
source§impl Clone for MsgFlashDone
impl Clone for MsgFlashDone
source§fn clone(&self) -> MsgFlashDone
fn clone(&self) -> MsgFlashDone
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 moresource§impl ConcreteMessage for MsgFlashDone
impl ConcreteMessage for MsgFlashDone
source§const MESSAGE_TYPE: u16 = 224u16
const MESSAGE_TYPE: u16 = 224u16
The message type.
source§const MESSAGE_NAME: &'static str = "MSG_FLASH_DONE"
const MESSAGE_NAME: &'static str = "MSG_FLASH_DONE"
The message name.
source§impl Debug for MsgFlashDone
impl Debug for MsgFlashDone
source§impl<'de> Deserialize<'de> for MsgFlashDone
impl<'de> Deserialize<'de> for MsgFlashDone
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl FriendlyName for MsgFlashDone
impl FriendlyName for MsgFlashDone
fn friendly_name() -> &'static str
source§impl From<MsgFlashDone> for Sbp
impl From<MsgFlashDone> for Sbp
source§fn from(msg: MsgFlashDone) -> Self
fn from(msg: MsgFlashDone) -> Self
Converts to this type from the input type.
source§impl PartialEq for MsgFlashDone
impl PartialEq for MsgFlashDone
source§fn eq(&self, other: &MsgFlashDone) -> bool
fn eq(&self, other: &MsgFlashDone) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl SbpMessage for MsgFlashDone
impl SbpMessage for MsgFlashDone
source§fn message_name(&self) -> &'static str
fn message_name(&self) -> &'static str
Get the message name.
source§fn message_type(&self) -> Option<u16>
fn message_type(&self) -> Option<u16>
Get the message type.
source§fn set_sender_id(&mut self, new_id: u16)
fn set_sender_id(&mut self, new_id: u16)
Set the sender id.
source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Number of bytes this message will take on the wire.
source§fn is_valid(&self) -> bool
fn is_valid(&self) -> bool
Tells you if the message is valid or if it is not a valid message and may need to be
special cased at certain points.
fn into_valid_msg(self) -> Result<Self, Invalid>
source§fn gps_time(&self) -> Option<Result<MessageTime, GpsTimeError>>
fn gps_time(&self) -> Option<Result<MessageTime, GpsTimeError>>
Get the GPS time associated with the message.
source§fn friendly_name(&self) -> &'static str
fn friendly_name(&self) -> &'static str
Get friendly name associated with the message.
source§impl Serialize for MsgFlashDone
impl Serialize for MsgFlashDone
source§impl TryFrom<Sbp> for MsgFlashDone
impl TryFrom<Sbp> for MsgFlashDone
impl StructuralPartialEq for MsgFlashDone
Auto Trait Implementations§
impl Freeze for MsgFlashDone
impl RefUnwindSafe for MsgFlashDone
impl Send for MsgFlashDone
impl Sync for MsgFlashDone
impl Unpin for MsgFlashDone
impl UnwindSafe for MsgFlashDone
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
source§impl<T> Event for Twhere
T: ConcreteMessage,
impl<T> Event for Twhere
T: ConcreteMessage,
source§const MESSAGE_TYPES: &'static [u16] = const MESSAGE_TYPES: &'static [u16] = &[T::MESSAGE_TYPE];
const MESSAGE_TYPES: &'static [u16] = const MESSAGE_TYPES: &'static [u16] = &[T::MESSAGE_TYPE];
The message types that correspond to this event. An empty slice means all messages.