pub struct EventLoop<'nvml> { /* private fields */ }
Expand description

Holds the EventSet utilized within an event loop.

A usage example is available (examples/event_loop.rs). It can be run as follows:

cargo run --example event_loop

Implementations

Register another device that this EventLoop should receive events for.

This method takes ownership of this struct and then hands it back to you if everything went well with the registration process.

Errors
  • Uninitialized, if the library has not been successfully initialized
  • GpuLost, if a GPU has fallen off the bus or is otherwise inaccessible
  • Unknown, on any unexpected error
Platform Support

Only supports Linux.

Handle events with the given callback until the loop is manually interrupted.

Errors

The function itself does not return anything. You will be given errors to handle within your closure if they occur; events are handed to you wrapped in a Result.

The errors that you will need to handle are:

  • Uninitialized, if the library has not been successfully initialized
  • GpuLost, if a GPU has fallen off the bus or is otherwise inaccessible
  • Unknown, on any unexpected error
Examples

See the event_loop example in the examples directory at the root.

Platform Support

Only supports Linux.

Obtain a reference to the EventSet contained within this struct.

Obtain a mutable reference to the EventSet contained within this struct.

Consumes this EventLoop and yields the EventSet contained within.

Trait Implementations

Converts to this type from the input type.

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.