Struct git2::Cred [] [src]

pub struct Cred {
    // some fields omitted
}

A structure to represent git credentials in libgit2.

Methods

impl Cred
[src]

fn default() -> Result<CredError>

Create a "default" credential usable for Negotiate mechanisms like NTLM or Kerberos authentication.

fn ssh_key_from_agent(username: &str) -> Result<CredError>

Create a new ssh key credential object used for querying an ssh-agent.

The username specified is the username to authenticate.

fn ssh_key(username: &str, publickey: Option<&Path>, privatekey: &Path, passphrase: Option<&str>) -> Result<CredError>

Create a new passphrase-protected ssh key credential object.

fn userpass_plaintext(username: &str, password: &str) -> Result<CredError>

Create a new plain-text username and password credential object.

fn credential_helper(config: &Config, url: &str, username: Option<&str>) -> Result<CredError>

Attempt to read credential.helper according to gitcredentials(7) 1

This function will attempt to parse the user's credential.helper configuration, invoke the necessary processes, and read off what the username/password should be for a particular url.

The returned credential type will be a username/password credential if successful.

fn username(username: &str) -> Result<CredError>

Create a credential to specify a username.

THis is used with ssh authentication to query for the username if non is specified in the url.

fn has_username(&self) -> bool

Check whether a credential object contains username information.

fn credtype(&self) -> git_credtype_t

Return the type of credentials that this object represents.

unsafe fn unwrap(self) -> *mut git_cred

Unwrap access to the underlying raw pointer, canceling the destructor

Trait Implementations

impl Drop for Cred
[src]

fn drop(&mut self)

A method called when the value goes out of scope. Read more