[][src]Function sibyl::env

pub fn env() -> Result<Environment>

Returns a new environment handle, which is then used by the OCI functions.

While there can be multiple environments, most application likely will only need one.

As nothing can outlive the environment at which it was created, when only one environment is used, it might be created in main:

use sibyl as oracle; // pun intended :)
fn main() {
    let oraenv = oracle::env().expect("Oracle OCI environment");
    // ...
}

Or even statically:

This example is not tested
use sibyl::Environment;
lazy_static! {
    pub static ref ORACLE : Environment = sibyl::env().expect("Oracle OCI environment");
}