Skip to main content

SystemEventSet

Struct SystemEventSet 

Source
pub struct SystemEventSet(/* private fields */);

Implementations§

Source§

impl SystemEventSet

Source

pub fn register_events(&self, event_types: SystemEventTypes) -> Result<()>

Starts recording the requested events for the system event set.

For Linux only.

Starts recording events on the specified device. All events that occurred before this call are not recorded. Use SystemEventSet::wait to check whether an event occurred.

If NVML reports Status::Unknown, the event set is in an undefined state and must be freed. If NVML reports Status::NotSupported, the event set can still be used, but none of the requested event types are registered.

§Errors

Returns an error if the installed NVML version does not support the request layout, if NVML rejects the event registration request, if NVML has not been initialized, or if NVML reports an unexpected failure.

Source

pub fn wait( &self, timeout_ms: u32, max_events: u32, ) -> Result<Vec<SystemEventData>>

Waits for system events and returns ready events.

For Fermi or newer fully supported devices.

If events are ready when this is called, it returns immediately. If no events are ready, it sleeps until an event arrives or timeout_ms expires. In some conditions, such as an interrupt, this can return before the timeout expires.

If the returned event count equals the internal event-buffer capacity, there may be outstanding events. Call SystemEventSet::wait again to query all events.

§Errors

Returns an error if the installed NVML version does not support the request layout, if NVML rejects the wait request, if no event arrives before timeout_ms, if NVML has not been initialized, or if NVML reports an unexpected failure.

Trait Implementations§

Source§

impl Debug for SystemEventSet

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for SystemEventSet

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.