pub struct Producer<'a, T: Copy> { /* private fields */ }Expand description
Unique, stateless write handle for a LatestBuf.
This handle is Send when T: Send (the handle can move a payload
across contexts, so a non-Send payload correctly pins it — T: Copy
alone does not imply T: Send) and always !Sync: it may move into an
ISR or another execution context, but it may not be shared between
contexts. Sole-producer ownership is load-bearing for the exclusive-slot
soundness argument (contract H2).
ⓘ
use ph_eventing::latest_buf::Producer;
fn assert_sync<T: Sync>() {}
assert_sync::<Producer<'static, u32>>();Implementations§
Trait Implementations§
Source§impl<T: Copy> LatestSink<T> for Producer<'_, T>
impl<T: Copy> LatestSink<T> for Producer<'_, T>
Source§fn publish_latest(&mut self, value: T) -> PublishReport
fn publish_latest(&mut self, value: T) -> PublishReport
Publish
value and report its generation and any replacement.Auto Trait Implementations§
impl<'a, T> !RefUnwindSafe for Producer<'a, T>
impl<'a, T> !Sync for Producer<'a, T>
impl<'a, T> !UnwindSafe for Producer<'a, T>
impl<'a, T> Freeze for Producer<'a, T>
impl<'a, T> Send for Producer<'a, T>where
T: Send,
impl<'a, T> Unpin for Producer<'a, T>
impl<'a, T> UnsafeUnpin for Producer<'a, T>
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