pub struct TargetSlot<const N: usize> { /* private fields */ }Expand description
The latest target, N f64s, as a single-writer seqlock: the sequence number is odd
while a write is in progress and changes with every write, so a reader that sees the
same even number before and after loading the values has a consistent set. Reads never
block and never spin unboundedly, which is what lets the realtime loop poll it every
cycle; writes are wait-free too, but there must be only one writer at a time, which the
handles serialise with a mutex on the user side.
The Default slot holds zeros with sequence 0, which TargetSlot::load reports as
“never written” through its false return: the loop then keeps the target it has.
Implementations§
Trait Implementations§
Source§impl<const N: usize> Debug for TargetSlot<N>
impl<const N: usize> Debug for TargetSlot<N>
Auto Trait Implementations§
impl<const N: usize> !Freeze for TargetSlot<N>
impl<const N: usize> RefUnwindSafe for TargetSlot<N>
impl<const N: usize> Send for TargetSlot<N>
impl<const N: usize> Sync for TargetSlot<N>
impl<const N: usize> Unpin for TargetSlot<N>
impl<const N: usize> UnsafeUnpin for TargetSlot<N>
impl<const N: usize> UnwindSafe for TargetSlot<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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.