pub struct SegmentWriter<'a> { /* private fields */ }Expand description
Splits a byte buffer into SDO download data segments, tracking the toggle bit. Drive it after a successful download-initiate handshake: emit each frame, await its acknowledgement, then take the next.
Implementations§
Source§impl<'a> SegmentWriter<'a>
impl<'a> SegmentWriter<'a>
Sourcepub const fn new(data: &'a [u8]) -> Self
pub const fn new(data: &'a [u8]) -> Self
Start splitting data (which should be the >4-byte value already
declared in the initiate request).
Sourcepub fn next_segment(&mut self) -> Option<SdoPayload>
pub fn next_segment(&mut self) -> Option<SdoPayload>
Produce the next download data-segment frame, or None when finished.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for SegmentWriter<'a>
impl<'a> RefUnwindSafe for SegmentWriter<'a>
impl<'a> Send for SegmentWriter<'a>
impl<'a> Sync for SegmentWriter<'a>
impl<'a> Unpin for SegmentWriter<'a>
impl<'a> UnsafeUnpin for SegmentWriter<'a>
impl<'a> UnwindSafe for SegmentWriter<'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