Struct crs_bind::rtos::Semaphore[][src]

pub struct Semaphore(_);

Represents a FreeRTOS counting semaphore.

Implementations

impl Semaphore[src]

pub fn new(max_count: u32, init_count: u32) -> Self[src]

Creates a new semaphore. Panics on failure; see Semaphore::try_new.

pub fn try_new(max_count: u32, init_count: u32) -> Result<Self, Error>[src]

Creates a new semaphore.

pub fn wait(&self, timeout: Duration) -> Result<(), Error>[src]

Blocks up to timeout until an instance of the semaphore can be taken (i.e., its count decremented). If the semaphore cannot be taken (due to timeout or other reason), an error is returned.

pub fn post(&self) -> Result<(), Error>[src]

Increments the semaphore’s count. If the semaphore cannot be given, an error is returned.

pub fn count(&self) -> u32[src]

Gets the semaphore’s current count.

Trait Implementations

impl Drop for Semaphore[src]

impl Send for Semaphore[src]

impl Sync for Semaphore[src]

Auto Trait Implementations

impl Unpin for Semaphore

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.