pub enum ThreadNotification {
NoAction,
SetBits(u32),
Increment,
SetValueWithOverwrite(u32),
SetValueWithoutOverwrite(u32),
}Expand description
Thread notification actions.
Defines different ways to notify a thread using the FreeRTOS task notification mechanism. Task notifications provide a lightweight alternative to semaphores and queues for simple signaling.
§Examples
ⓘ
use osal_rs::os::{Thread, ThreadNotification};
let thread = Thread::current();
// Increment notification counter
thread.notify_with_action(ThreadNotification::Increment);
// Set specific bits
thread.notify_with_action(ThreadNotification::SetBits(0b1010));
// Set value, overwriting any existing value
thread.notify_with_action(ThreadNotification::SetValueWithOverwrite(42));Variants§
NoAction
Don’t update the notification value
SetBits(u32)
Bitwise OR the notification value with the specified bits
Increment
Increment the notification value by one
SetValueWithOverwrite(u32)
Set the notification value, overwriting any existing value
SetValueWithoutOverwrite(u32)
Set the notification value only if the receiving thread has no pending notifications
Trait Implementations§
Source§impl Clone for ThreadNotification
impl Clone for ThreadNotification
Source§fn clone(&self) -> ThreadNotification
fn clone(&self) -> ThreadNotification
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 ThreadNotification
impl Debug for ThreadNotification
impl Copy for ThreadNotification
Auto Trait Implementations§
impl Freeze for ThreadNotification
impl RefUnwindSafe for ThreadNotification
impl Send for ThreadNotification
impl Sync for ThreadNotification
impl Unpin for ThreadNotification
impl UnwindSafe for ThreadNotification
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