pub struct BlockSegment {
pub c: bool,
pub seqnum: u8,
pub data: [u8; 7],
}Expand description
Represents the CAN message used to send a segment during a block upload or download
Fields§
§c: boolComplete flag
Indicates this is the last segment in the block transfer
seqnum: u8The sequence number for the segment
The sequence number starts at 1 on the first segment of a block, and increments on subsequent segment, up to a maximum of 127.
data: [u8; 7]The data bytes of this segment
Implementations§
Source§impl BlockSegment
impl BlockSegment
Sourcepub fn to_can_message(&self, id: CanId) -> CanMessage
pub fn to_can_message(&self, id: CanId) -> CanMessage
Create a CanMessage from the BlockSegment for transmission
Trait Implementations§
Source§impl Clone for BlockSegment
impl Clone for BlockSegment
Source§fn clone(&self) -> BlockSegment
fn clone(&self) -> BlockSegment
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BlockSegment
impl Debug for BlockSegment
Source§impl PartialEq for BlockSegment
impl PartialEq for BlockSegment
Source§impl TryFrom<&[u8]> for BlockSegment
impl TryFrom<&[u8]> for BlockSegment
impl Copy for BlockSegment
impl StructuralPartialEq for BlockSegment
Auto Trait Implementations§
impl Freeze for BlockSegment
impl RefUnwindSafe for BlockSegment
impl Send for BlockSegment
impl Sync for BlockSegment
impl Unpin for BlockSegment
impl UnwindSafe for BlockSegment
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
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>
Converts
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>
Converts
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