Struct nvml_wrapper::event::EventSet
[−]
[src]
pub struct EventSet<'nvml> { /* fields omitted */ }
Handle to a set of events.
Operations on a set are not thread-safe. It does not, therefore, implement Sync
.
Once again, Rust's lifetimes will ensure that this EventSet
does not outlive the
NVML
instance that it was created from.
Methods
impl<'nvml> EventSet<'nvml>
[src]
fn release_events(self) -> Result<()>
Use this to release the set's events if you care about handling
potential errors (the Drop
implementation ignores errors!).
Errors
Uninitialized
, if the library has not been successfully initializedUnknown
, on any unexpected error
fn wait(&self, timeout_ms: u32) -> Result<EventData<'nvml>>
Waits on events for the given timeout (in ms) and delivers one when it arrives.
This method returns immediately if an event is ready to be delivered when it is called. If no events are ready it will sleep until an event arrives, but not longer than the specified timeout. In certain conditions, this method could return before the timeout passes (e.g. when an interrupt arrives).
In the case of an XID error, the function returns the most recent XID error type seen by the system. If there are multiple XID errors generated before this method is called, the last seen XID error type will be returned for all XID error events.
Errors
Uninitialized
, if the library has not been successfully initializedTimeout
, if no event arrived in the specified timeout or an interrupt arrivedGpuLost
, if a GPU has fallen off the bus or is otherwise inaccessibleUnknown
, on any unexpected error
Device Support
Supports Fermi and newer fully supported devices.
fn into_raw(self) -> nvmlEventSet_t
Consume the struct and obtain the raw set handle that it contains.
fn as_raw(&self) -> &nvmlEventSet_t
Obtain a reference to the raw set handle contained in the struct.
fn as_mut_raw(&mut self) -> &mut nvmlEventSet_t
Obtain a mutable reference to the raw set handle contained in the struct.
unsafe fn unsafe_raw(&self) -> nvmlEventSet_t
Sometimes necessary for C interop. Use carefully.
Trait Implementations
impl<'nvml> Debug for EventSet<'nvml>
[src]
impl<'nvml> Send for EventSet<'nvml>
[src]
impl<'nvml> From<nvmlEventSet_t> for EventSet<'nvml>
[src]
fn from(set: nvmlEventSet_t) -> Self
Performs the conversion.
impl<'nvml> Drop for EventSet<'nvml>
[src]
This Drop
implementation ignores errors! Use the .release_events()
method on the EventSet
struct if you care about handling them.