Function what_git::what_git[][src]

pub async fn what_git(repository: &str, token: &str) -> Result

Determines what source control management (SCM) solution a repository URL belongs to. Returns a what_git::Result type describing the structure of the URL and the associated what_git::SCMKind, or some error of type what_git::Error.

Examples

use what_git::{what_git, SCMKind};

async {
    let scm = what_git("https://github.com/rust-lang/rust", "<PERSONAL ACCESS TOKEN>")
        .await
        .map(|scm| match scm.kind {
            SCMKind::GitHub => println!("Do something with GitHub..."),
            _ => unimplemented!(),
        });
};