pub struct DynamicDeferredCall { /* private fields */ }
Expand description

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

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.

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.

Call the globally registered instance

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

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

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

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.

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).

Register a new client

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

A given DynamicDeferredCallClient reference (client) can be registered multiple times and will receive a different handle each time. This mechanism is useful to distinguish between deferred calls scheduled by the same client, but to be handled differently. Each issued handle will occupy one DynamicDeferredCallClientState in the DynamicDeferredCall. Clients can utilize the passed DeferredCallHandle to distinguish between scheduled deferred calls.

Check if one or more deferred calls are pending

Returns true if one or more deferred calls are pending.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.