pub struct TransferRequest<'a> {
pub bus: u8,
pub addr: u8,
/* private fields */
}Expand description
A CMD_I2C_TRANSFER request whose structure has been validated.
Fields§
§bus: u8§addr: u8The 7-bit address.
Implementations§
Source§impl<'a> TransferRequest<'a>
impl<'a> TransferRequest<'a>
Sourcepub fn parse(payload: &'a [u8]) -> Result<Self, I2cError>
pub fn parse(payload: &'a [u8]) -> Result<Self, I2cError>
Decode and validate a CMD_I2C_TRANSFER payload.
Sourcepub const fn from_parts(bus: u8, addr: u8, ops: &'a [u8]) -> Self
pub const fn from_parts(bus: u8, addr: u8, ops: &'a [u8]) -> Self
Reassemble a request from its parts, for a device that staged the operation list of a request it already validated.
Sourcepub const fn encoded_ops(&self) -> &'a [u8]
pub const fn encoded_ops(&self) -> &'a [u8]
The operation list in wire form.
Sourcepub fn shape(&self) -> TransferShape
pub fn shape(&self) -> TransferShape
Sum the list up. Malformed operations are skipped, so call this
on a request that Self::parse accepted.
Trait Implementations§
Source§impl<'a> Clone for TransferRequest<'a>
impl<'a> Clone for TransferRequest<'a>
Source§fn clone(&self) -> TransferRequest<'a>
fn clone(&self) -> TransferRequest<'a>
Returns a duplicate of the value. Read more
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for TransferRequest<'a>
impl<'a> Debug for TransferRequest<'a>
Source§impl<'a> PartialEq for TransferRequest<'a>
impl<'a> PartialEq for TransferRequest<'a>
impl<'a> Copy for TransferRequest<'a>
impl<'a> Eq for TransferRequest<'a>
impl<'a> StructuralPartialEq for TransferRequest<'a>
Auto Trait Implementations§
impl<'a> Freeze for TransferRequest<'a>
impl<'a> RefUnwindSafe for TransferRequest<'a>
impl<'a> Send for TransferRequest<'a>
impl<'a> Sync for TransferRequest<'a>
impl<'a> Unpin for TransferRequest<'a>
impl<'a> UnwindSafe for TransferRequest<'a>
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)