Struct sbp::messages::file_io::msg_fileio_write_req::MsgFileioWriteReq
source · pub struct MsgFileioWriteReq {
pub sender_id: Option<u16>,
pub sequence: u32,
pub offset: u32,
pub filename: SbpString<Vec<u8>, NullTerminated>,
pub data: Vec<u8>,
}
Expand description
Write to file (host => device)
The file write message writes a certain length (up to 255 bytes) of data to a file at a given offset. Returns a copy of the original MSG_FILEIO_WRITE_RESP message to check integrity of the write. The sequence number in the request will be returned in the response. If message is invalid, a followup MSG_PRINT message will print “Invalid fileio write message”. A device will only process this message when it is received from sender ID 0x42.
Fields§
§sender_id: Option<u16>
The message sender_id
sequence: u32
Write sequence number
offset: u32
Offset into the file at which to start writing in bytes
filename: SbpString<Vec<u8>, NullTerminated>
Name of the file to write to
data: Vec<u8>
Variable-length array of data to write
Trait Implementations§
source§impl Clone for MsgFileioWriteReq
impl Clone for MsgFileioWriteReq
source§fn clone(&self) -> MsgFileioWriteReq
fn clone(&self) -> MsgFileioWriteReq
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 MsgFileioWriteReq
impl ConcreteMessage for MsgFileioWriteReq
source§const MESSAGE_TYPE: u16 = 173u16
const MESSAGE_TYPE: u16 = 173u16
The message type.
source§const MESSAGE_NAME: &'static str = "MSG_FILEIO_WRITE_REQ"
const MESSAGE_NAME: &'static str = "MSG_FILEIO_WRITE_REQ"
The message name.
source§impl Debug for MsgFileioWriteReq
impl Debug for MsgFileioWriteReq
source§impl<'de> Deserialize<'de> for MsgFileioWriteReq
impl<'de> Deserialize<'de> for MsgFileioWriteReq
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 MsgFileioWriteReq
impl FriendlyName for MsgFileioWriteReq
fn friendly_name() -> &'static str
source§impl From<MsgFileioWriteReq> for Sbp
impl From<MsgFileioWriteReq> for Sbp
source§fn from(msg: MsgFileioWriteReq) -> Self
fn from(msg: MsgFileioWriteReq) -> Self
Converts to this type from the input type.
source§impl PartialEq for MsgFileioWriteReq
impl PartialEq for MsgFileioWriteReq
source§fn eq(&self, other: &MsgFileioWriteReq) -> bool
fn eq(&self, other: &MsgFileioWriteReq) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl SbpMessage for MsgFileioWriteReq
impl SbpMessage for MsgFileioWriteReq
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 MsgFileioWriteReq
impl Serialize for MsgFileioWriteReq
source§impl TryFrom<Sbp> for MsgFileioWriteReq
impl TryFrom<Sbp> for MsgFileioWriteReq
impl StructuralPartialEq for MsgFileioWriteReq
Auto Trait Implementations§
impl Freeze for MsgFileioWriteReq
impl RefUnwindSafe for MsgFileioWriteReq
impl Send for MsgFileioWriteReq
impl Sync for MsgFileioWriteReq
impl Unpin for MsgFileioWriteReq
impl UnwindSafe for MsgFileioWriteReq
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.