Skip to main content

ImageUpload

Struct ImageUpload 

Source
pub struct ImageUpload<'a, 'b> {
    pub image: Option<u32>,
    pub len: Option<u64>,
    pub off: u64,
    pub sha: Option<&'a [u8; 32]>,
    pub data: &'b [u8],
    pub upgrade: Option<bool>,
}
Expand description

Image Upload command

Fields§

§image: Option<u32>

optional image number, it does not have to appear in request at all, in which case it is assumed to be 0.

Should only be present when “off” is 0.

§len: Option<u64>

optional length of an image.

Must appear when “off” is 0.

§off: u64

offset of image chunk the request carries.

§sha: Option<&'a [u8; 32]>

SHA256 hash of an upload; this is used to identify an upload session (e.g. to allow MCUmgr to continue a broken session), and for image verification purposes. This must be a full SHA256 hash of the whole image being uploaded, or not included if the hash is not available (in which case, upload session continuation and image verification functionality will be unavailable).

Should only be present when “off” is 0.

§data: &'b [u8]

image data to write at provided offset.

§upgrade: Option<bool>

optional flag that states that only upgrade should be allowed, so if the version of uploaded software is not higher than already on a device, the image upload will be rejected.

Should only be present when “off” is 0.

Trait Implementations§

Source§

impl<'a, 'b> Debug for ImageUpload<'a, 'b>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl McuMgrCommand for ImageUpload<'_, '_>

Source§

type Payload = ImageUpload<'_, '_>

the data payload type
Source§

type Response = ImageUploadResponse

the response type of the command
Source§

fn is_write_operation(&self) -> bool

whether this command is a read or write operation
Source§

fn group_id(&self) -> u16

the group ID of the command
Source§

fn command_id(&self) -> u8

the command ID
Source§

fn data(&self) -> &Self

the data
Source§

impl<'a, 'b> PartialEq for ImageUpload<'a, 'b>

Source§

fn eq(&self, other: &ImageUpload<'a, 'b>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<'a, 'b> Serialize for ImageUpload<'a, 'b>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<'a, 'b> Eq for ImageUpload<'a, 'b>

Source§

impl<'a, 'b> StructuralPartialEq for ImageUpload<'a, 'b>

Auto Trait Implementations§

§

impl<'a, 'b> Freeze for ImageUpload<'a, 'b>

§

impl<'a, 'b> RefUnwindSafe for ImageUpload<'a, 'b>

§

impl<'a, 'b> Send for ImageUpload<'a, 'b>

§

impl<'a, 'b> Sync for ImageUpload<'a, 'b>

§

impl<'a, 'b> Unpin for ImageUpload<'a, 'b>

§

impl<'a, 'b> UnwindSafe for ImageUpload<'a, 'b>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V