pub struct Segment<'a> {
pub toggle: bool,
pub last: bool,
pub data: &'a [u8],
}Expand description
A decoded SDO data segment: its toggle bit, whether it is the last segment, and the (borrowed) data bytes it carries.
The download-segment request (client → server) and the upload-segment response (server → client) share this exact frame layout, so one type and one codec serve both directions.
Fields§
§toggle: boolThe toggle bit for this segment (alternates each segment from false).
last: boolWhether this is the final segment of the transfer.
data: &'a [u8]The segment’s payload (1..=7 bytes).
Trait Implementations§
impl<'a> Copy for Segment<'a>
impl<'a> Eq for Segment<'a>
impl<'a> StructuralPartialEq for Segment<'a>
Auto Trait Implementations§
impl<'a> Freeze for Segment<'a>
impl<'a> RefUnwindSafe for Segment<'a>
impl<'a> Send for Segment<'a>
impl<'a> Sync for Segment<'a>
impl<'a> Unpin for Segment<'a>
impl<'a> UnsafeUnpin for Segment<'a>
impl<'a> UnwindSafe for Segment<'a>
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