[][src]Struct nvml_wrapper::NvmlBuilder

pub struct NvmlBuilder<'a> { /* fields omitted */ }

A builder struct that provides further flexibility in how NVML is initialized.

Examples

Initialize NVML with a non-default name for the shared object file:

use nvml_wrapper::NVML;
use std::ffi::OsStr;

let init_result = NVML::builder().lib_path(OsStr::new("libnvidia-ml-other-name.so")).init();

Initialize NVML with a non-default path to the shared object file:

use nvml_wrapper::NVML;
use std::ffi::OsStr;

let init_result = NVML::builder().lib_path(OsStr::new("/some/path/to/libnvidia-ml.so")).init();

Implementations

impl<'a> NvmlBuilder<'a>[src]

pub fn lib_path(&mut self, path: &'a OsStr) -> &mut Self[src]

Set the path to the NVML lib file.

See libloading's docs for details about how this lib path is handled.

pub fn flags(&mut self, flags: InitFlags) -> &mut Self[src]

Set the InitFlags to initialize NVML with.

pub fn init(&self) -> Result<NVML, NvmlError>[src]

Perform initialization.

Trait Implementations

impl<'a> Clone for NvmlBuilder<'a>[src]

impl<'a> Debug for NvmlBuilder<'a>[src]

impl<'a> Default for NvmlBuilder<'a>[src]

impl<'a> Eq for NvmlBuilder<'a>[src]

impl<'a> PartialEq<NvmlBuilder<'a>> for NvmlBuilder<'a>[src]

impl<'a> StructuralEq for NvmlBuilder<'a>[src]

impl<'a> StructuralPartialEq for NvmlBuilder<'a>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for NvmlBuilder<'a>

impl<'a> Send for NvmlBuilder<'a>

impl<'a> Sync for NvmlBuilder<'a>

impl<'a> Unpin for NvmlBuilder<'a>

impl<'a> UnwindSafe for NvmlBuilder<'a>

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.