1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
#![allow(non_camel_case_types, non_snake_case)]
#![doc(html_root_url = "http://arcnmx.github.io/nvapi-rs/")]
#[cfg(windows)]
extern crate winapi;
#[macro_use]
extern crate bitflags;
#[cfg(feature = "serde_derive")]
#[macro_use]
extern crate serde_derive;
#[macro_use]
mod macros;
#[macro_use]
mod debug_array;
pub use debug_array::Array;
pub mod nvid;
pub mod nvapi;
pub mod status;
pub mod types;
pub mod handles;
pub mod driverapi;
pub mod gpu;
pub mod i2c;
#[cfg(windows)]
pub mod dx;
pub mod dispcontrol;
pub use nvid::Api;
pub use nvapi::nvapi_QueryInterface;
pub use types::*;
pub use status::{NvAPI_Status, Status};
use std::result;
pub type Result<T> = result::Result<T, Status>;
pub fn status_result(status: NvAPI_Status) -> Result<()> {
match status {
status::NVAPI_OK => Ok(()),
status => Err(Status::from_raw(status).unwrap_or(Status::Error)),
}
}
#[derive(Debug, Copy, Clone, Default)]
pub struct ArgumentRangeError;
impl From<ArgumentRangeError> for Status {
fn from(_: ArgumentRangeError) -> Self {
Status::ArgumentExceedMaxSize
}
}