Skip to main content

Producer

Struct Producer 

Source
pub struct Producer<'a> { /* private fields */ }
Expand description

The sole raising handle for an EventFlags value.

This handle is Send + !Sync: it may move into an ISR or another execution context, but it may not be shared between contexts.

use ph_eventing::event_flags::Producer;

fn assert_sync<T: Sync>() {}
assert_sync::<Producer<'static>>();

Implementations§

Source§

impl Producer<'_>

Source

pub fn raise(&self, mask: EventMask)

Raise every condition in mask.

The operation is exactly one source-level atomic fetch_or: no algorithmic retry loop, and it never waits, allocates, calls user code, or panics. How the single RMW is realised is per-ISA — a lone amoor.w on RISC-V, a gated four-instruction PRIMASK critical section on Cortex-M0, and an LDREX/STREX pair on exclusive-monitor ARM, where a lost reservation (an intervening interrupt, or the concurrent take’s swap) repeats the pair. That hardware retry is bounded by contention on the one shared word, not by anything this code does; the uncontended cost is the measured row. A concurrent take observes this raise in its own snapshot or leaves it pending for the following take.

Trait Implementations§

Source§

impl Debug for Producer<'_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for Producer<'_>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Producer<'a>

§

impl<'a> !Sync for Producer<'a>

§

impl<'a> Freeze for Producer<'a>

§

impl<'a> Send for Producer<'a>

§

impl<'a> Unpin for Producer<'a>

§

impl<'a> UnsafeUnpin for Producer<'a>

§

impl<'a> UnwindSafe for Producer<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.