odbc_api/
driver_complete_option.rs

1/// Specifies how the driver and driver manager complete the incoming connection string. See
2/// [`crate::Environment::driver_connect`].
3#[derive(Clone, Copy, Debug)]
4pub enum DriverCompleteOption {
5    /// Do not show a prompt to the user. This implies that the connection string, must already
6    /// provide all information needed to Connect to the data source, otherwise the operation fails.
7    /// This is the only supported variant on non windows platforms
8    NoPrompt,
9    /// Always show a prompt to the user.
10    Prompt,
11    /// Only show a prompt to the user if the information in the connection string is not sufficient
12    /// to connect to the data source.
13    Complete,
14    /// Like complete, but the user may not change any information already provided within the
15    /// connection string.
16    CompleteRequired,
17}
18
19impl DriverCompleteOption {
20    pub fn as_sys(&self) -> odbc_sys::DriverConnectOption {
21        match self {
22            DriverCompleteOption::NoPrompt => odbc_sys::DriverConnectOption::NoPrompt,
23            DriverCompleteOption::Prompt => odbc_sys::DriverConnectOption::Prompt,
24            DriverCompleteOption::Complete => odbc_sys::DriverConnectOption::Complete,
25            DriverCompleteOption::CompleteRequired => {
26                odbc_sys::DriverConnectOption::CompleteRequired
27            }
28        }
29    }
30}