[−][src]Struct sunrise_libuser::types::ReadableEvent
The readable part of an event. The user shall use this end to verify if the event is signaled, and wait for the signaling through wait_synchronization. The user can also use this handle to clear the signaled state through ReadableEvent::clear().
Implementations
impl ReadableEvent
[src]
pub fn clear(&self) -> Result<(), KernelError>
[src]
Clears the signaled state.
pub fn wait_async(
&self,
queue: WorkQueue
) -> impl Future<Output = Result<(), Error>> + Unpin
[src]
&self,
queue: WorkQueue
) -> impl Future<Output = Result<(), Error>> + Unpin
Waits for the event to get signaled.
Note: This function is a bit of a footgun. If you intend to have multiple futures wait on the same event (to use it like a semaphore), please look at ReadableEvent::wait_async_cb() instead.
Panics
Panics if used from outside the context of a Future spawned on a libuser future executor. Please make sure you only call this function from a future spawned on a WaitableManager.
pub fn wait_async_cb<F, T>(
&self,
queue: WorkQueue,
f: F
) -> impl Future<Output = T> + Unpin where
F: FnMut() -> Option<T> + Unpin,
[src]
&self,
queue: WorkQueue,
f: F
) -> impl Future<Output = T> + Unpin where
F: FnMut() -> Option<T> + Unpin,
Turns this ReadableEvent into a semaphore-like structure.
This function will repeatedly run f
when the event is triggered, until
it returns true. When it returns false, the future will first clear the
event before waiting on it.
Panics
Panics if used from outside the context of a Future spawned on a libuser future executor. Please make sure you only call this function from a future spawned on a WaitableManager.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for ReadableEvent
impl Send for ReadableEvent
impl Sync for ReadableEvent
impl Unpin for ReadableEvent
impl UnwindSafe for ReadableEvent
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> SizedIPCBuffer for T
[src]
fn size(&Self) -> usize
[src]
fn is_cool(usize, usize) -> bool
[src]
unsafe fn from_raw_parts<'a>(usize, usize) -> &'a T
[src]
unsafe fn from_raw_parts_mut<'a>(usize, usize) -> &'a mut T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,