ci_info::get - Rust
Description: API documentation for the Rust `get` fn in crate `ci_info`.
Keywords: rust, rustlang, rust-lang, get

# [−][src]Function ci_info::get

    pub fn get() -> CiInfo

Loads and returns the CI info of the current environment.

# Example

    fn main() {
        // Just check if a CI environment is detected.
        let ci = ci_info::is_ci();
        println!("Is CI: {}", ci);

        // Get CI environment information
        let info = ci_info::get();
        println!("Is CI: {}", info.ci);
        if info.vendor.is_some() {
            println!("Vendor: {:#?}", info.vendor.unwrap());
            println!("Name: {:#?}", info.name.unwrap());
        }
        if info.pr.is_some() {
            println!("Is PR: {:#?}", info.pr.unwrap());
        }
        if info.branch_name.is_some() {
            println!("Branch Name: {:#?}", info.branch_name.unwrap());
        }
    }