pub struct PdoMapping<const N: usize> { /* private fields */ }Expand description
An ordered PDO mapping of up to N entries.
The mapped objects are packed into the frame in insertion order, and the total width may not exceed eight bytes (64 bits).
Implementations§
Source§impl<const N: usize> PdoMapping<N>
impl<const N: usize> PdoMapping<N>
Sourcepub fn push(&mut self, entry: MappingEntry) -> Result<()>
pub fn push(&mut self, entry: MappingEntry) -> Result<()>
Append a mapping entry.
Returns Error::PdoTooLong if it would push the total past 64 bits,
or Error::MappingFull if the fixed capacity N is exhausted.
Sourcepub fn entries(&self) -> &[MappingEntry]
pub fn entries(&self) -> &[MappingEntry]
The mapping entries, in packing order.
Sourcepub fn total_bits(&self) -> u32
pub fn total_bits(&self) -> u32
The total width of the mapped data, in bits.
Sourcepub fn total_bytes(&self) -> usize
pub fn total_bytes(&self) -> usize
The total width of the mapped data, in whole bytes (the CAN frame DLC).
Trait Implementations§
Source§impl<const N: usize> Debug for PdoMapping<N>
impl<const N: usize> Debug for PdoMapping<N>
Auto Trait Implementations§
impl<const N: usize> Freeze for PdoMapping<N>
impl<const N: usize> RefUnwindSafe for PdoMapping<N>
impl<const N: usize> Send for PdoMapping<N>
impl<const N: usize> Sync for PdoMapping<N>
impl<const N: usize> Unpin for PdoMapping<N>
impl<const N: usize> UnsafeUnpin for PdoMapping<N>
impl<const N: usize> UnwindSafe for PdoMapping<N>
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