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: u64offset 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> Clone for ImageUpload<'a, 'b>
impl<'a, 'b> Clone for ImageUpload<'a, 'b>
Source§fn clone(&self) -> ImageUpload<'a, 'b>
fn clone(&self) -> ImageUpload<'a, 'b>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a, 'b> Debug for ImageUpload<'a, 'b>
impl<'a, 'b> Debug for ImageUpload<'a, 'b>
Source§impl McuMgrCommand for ImageUpload<'_, '_>
impl McuMgrCommand for ImageUpload<'_, '_>
Source§type Payload = ImageUpload<'_, '_>
type Payload = ImageUpload<'_, '_>
Source§type Response = ImageUploadResponse
type Response = ImageUploadResponse
Source§fn is_write_operation(&self) -> bool
fn is_write_operation(&self) -> bool
Source§fn command_id(&self) -> u8
fn command_id(&self) -> u8
Source§impl<'a, 'b> PartialEq for ImageUpload<'a, 'b>
impl<'a, 'b> PartialEq for ImageUpload<'a, 'b>
Source§fn eq(&self, other: &ImageUpload<'a, 'b>) -> bool
fn eq(&self, other: &ImageUpload<'a, 'b>) -> bool
self and other values to be equal, and is used by ==.Source§impl<'a, 'b> Serialize for ImageUpload<'a, 'b>
impl<'a, 'b> Serialize for ImageUpload<'a, 'b>
impl<'a, 'b> Eq for ImageUpload<'a, 'b>
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> UnsafeUnpin for ImageUpload<'a, 'b>
impl<'a, 'b> UnwindSafe for ImageUpload<'a, 'b>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more