[][src]Struct kernel::common::dynamic_deferred_call::DynamicDeferredCall

pub struct DynamicDeferredCall { /* fields omitted */ }

Dynamic deferred call

This struct manages and calls dynamically (at runtime) registered deferred calls from capsules and other kernel structures.

It has a fixed number of possible clients, which is determined by the clients-array passed in with the constructor.

Implementations

impl DynamicDeferredCall[src]

pub fn new(
    client_states: &'static [DynamicDeferredCallClientState]
) -> DynamicDeferredCall
[src]

Construct a new dynamic deferred call implementation

This needs to be registered with the set_global_instance function immediately afterwards, and should not be changed anymore. Only the globally registered instance will receive calls from the kernel scheduler.

The clients array can be initialized using the implementation of Default for the DynamicDeferredCallClientState.

pub unsafe fn set_global_instance(ddc: &'static DynamicDeferredCall) -> bool[src]

Sets a global DynamicDeferredCall instance

This is required before any deferred calls can be retrieved. It may be called only once. Returns true if the global instance was successfully registered.

pub unsafe fn call_global_instance() -> bool[src]

Call the globally registered instance

Returns true if a global instance was registered and has been called.

pub unsafe fn call_global_instance_while<F: Fn() -> bool>(f: F) -> bool[src]

Call the globally registered instance while the supplied predicate returns true.

Returns true if a global instance was registered and has been called.

pub unsafe fn global_instance_calls_pending() -> Option<bool>[src]

Check if one or more dynamic deferred calls are pending in the globally registered instance

Returns None if no global instance has been registered, or Some(true) if the registered instance has one or more pending deferred calls.

pub fn set(&self, handle: DeferredCallHandle) -> Option<bool>[src]

Schedule a deferred call to be called

The handle addresses the client that will be called.

If no client for the handle is found (it was unregistered), this returns None. If a call is already scheduled, it returns Some(false).

pub fn register(
    &self,
    ddc_client: &'static dyn DynamicDeferredCallClient
) -> Option<DeferredCallHandle>
[src]

Register a new client

On success, a Some(handle) will be returned. This handle is later required to schedule a deferred call.

pub fn has_pending(&self) -> bool[src]

Check if one or more deferred calls are pending

Returns true if one or more deferred calls are pending.

Auto Trait Implementations

impl !Send for DynamicDeferredCall

impl !Sync for DynamicDeferredCall

impl Unpin for DynamicDeferredCall

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.