odbc_safe/
version.rs

1use sys::*;
2
3pub trait VersionOption {}
4
5/// Type indicates an ODBC Version
6pub unsafe trait Version: VersionOption {
7    /// The `SQL_ATTR_ODBC_VERSION` used with `SQLSetEnvAttr`
8    fn constant() -> OdbcVersion;
9}
10
11/// Used to indicate that the ODBC environments version is not yet declared
12#[derive(Debug, Clone, Copy)]
13pub struct NoVersion;
14
15impl VersionOption for NoVersion {}
16
17/// Used to declare ODBC 3 specifications.
18#[derive(Debug, Clone, Copy)]
19pub struct Odbc3;
20
21/// Used to declare ODBC 3.8 specifications.
22#[derive(Debug, Clone, Copy)]
23pub struct Odbc3m8;
24
25impl<V: Version> VersionOption for V {}
26
27unsafe impl Version for Odbc3 {
28    fn constant() -> OdbcVersion {
29        SQL_OV_ODBC3
30    }
31}
32
33unsafe impl Version for Odbc3m8 {
34    fn constant() -> OdbcVersion {
35        SQL_OV_ODBC3_80
36    }
37}