pub struct LineZoneMonitor<const N: usize> { /* private fields */ }Expand description
Tracks crossings of a finite directed line segment for at most N tracks.
Implementations§
Source§impl<const N: usize> LineZoneMonitor<N>
impl<const N: usize> LineZoneMonitor<N>
Sourcepub const fn new(zone_id: ZoneId, segment: LineSegment) -> Self
pub const fn new(zone_id: ZoneId, segment: LineSegment) -> Self
Creates a monitor for segment using caller-selected fixed track capacity.
Sourcepub fn update(
&mut self,
track_id: TrackId,
point: Point,
output: &mut [VisionEvent],
) -> Result<usize, CoreError>
pub fn update( &mut self, track_id: TrackId, point: Point, output: &mut [VisionEvent], ) -> Result<usize, CoreError>
Records a point sample and writes its crossing event to output[0] when needed.
§Errors
Returns CoreError::InsufficientCapacity when no track slot or required
event-output slot is available. On error, the monitor state is unchanged.
Sourcepub fn forget_track(&mut self, track_id: TrackId) -> bool
pub fn forget_track(&mut self, track_id: TrackId) -> bool
Removes a track’s stored crossing state without emitting an event.
Auto Trait Implementations§
impl<const N: usize> Freeze for LineZoneMonitor<N>
impl<const N: usize> RefUnwindSafe for LineZoneMonitor<N>
impl<const N: usize> Send for LineZoneMonitor<N>
impl<const N: usize> Sync for LineZoneMonitor<N>
impl<const N: usize> Unpin for LineZoneMonitor<N>
impl<const N: usize> UnsafeUnpin for LineZoneMonitor<N>
impl<const N: usize> UnwindSafe for LineZoneMonitor<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