pub struct Payload { /* private fields */ }
Expand description
A payload sent from the device.
Implementations§
source§impl Payload
impl Payload
sourcepub fn payload_type(&self) -> PayloadType
pub fn payload_type(&self) -> PayloadType
Returns PayloadType
of the payload.
sourcepub fn image_info(&self) -> Option<&ImageInfo>
pub fn image_info(&self) -> Option<&ImageInfo>
Returns ImageInfo
if payload_type
is PayloadType::Image
or
PayloadType::ImageExtendedChunk
.
sourcepub fn image(&self) -> Option<&[u8]>
pub fn image(&self) -> Option<&[u8]>
Returns the image bytes in the payload if payload_type
is PayloadType::Image
or
PayloadType::ImageExtendedChunk
.
sourcepub fn payload(&self) -> &[u8] ⓘ
pub fn payload(&self) -> &[u8] ⓘ
Returns the whole payload. Use Self::image
instead if you interested only
in image region of the payload.
Trait Implementations§
source§impl PartialEq<Payload> for Payload
impl PartialEq<Payload> for Payload
impl Eq for Payload
impl StructuralEq for Payload
impl StructuralPartialEq for Payload
Auto Trait Implementations§
impl RefUnwindSafe for Payload
impl Send for Payload
impl Sync for Payload
impl Unpin for Payload
impl UnwindSafe for Payload
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