pub enum ChunkResult {
Filled(usize),
Starved,
End,
}Expand description
Result returned by the fill callback indicating how the buffer was filled.
This enum allows the callback to communicate three distinct states:
- Successfully filled some number of points
- Temporarily unable to provide data (underrun policy applies)
- Stream should end gracefully
§Filled(0) Semantics
- If
target_points == 0: Buffer is full, nothing needed. This is fine. - If
target_points > 0: We needed points but got none. Treated asStarved.
Variants§
Filled(usize)
Wrote n points to the buffer.
n must be <= buffer.len().
Partial fills (n < min_points) are accepted without padding - useful when
content is legitimately ending. Return End on the next call to signal completion.
Starved
No data available right now.
Underrun policy is applied (repeat last chunk or blank). Stream continues; callback will be called again when buffer needs filling.
End
Stream is finished. Shutdown sequence:
- Stop calling callback
- Let queued points drain (play out)
- Blank/park the laser at last position
- Return from stream() with
RunExit::ProducerEnded
Trait Implementations§
Source§impl Clone for ChunkResult
impl Clone for ChunkResult
Source§fn clone(&self) -> ChunkResult
fn clone(&self) -> ChunkResult
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 ChunkResult
impl Debug for ChunkResult
Source§impl PartialEq for ChunkResult
impl PartialEq for ChunkResult
impl Copy for ChunkResult
impl Eq for ChunkResult
impl StructuralPartialEq for ChunkResult
Auto Trait Implementations§
impl Freeze for ChunkResult
impl RefUnwindSafe for ChunkResult
impl Send for ChunkResult
impl Sync for ChunkResult
impl Unpin for ChunkResult
impl UnsafeUnpin for ChunkResult
impl UnwindSafe for ChunkResult
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