Struct git2::Cred[][src]

pub struct Cred { /* fields omitted */ }
Expand description

A structure to represent git credentials in libgit2.

Implementations

impl Cred[src]

pub fn default() -> Result<Cred, Error>[src]

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

pub fn ssh_key_from_agent(username: &str) -> Result<Cred, Error>[src]

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

The username specified is the username to authenticate.

pub fn ssh_key(
    username: &str,
    publickey: Option<&Path>,
    privatekey: &Path,
    passphrase: Option<&str>
) -> Result<Cred, Error>
[src]

Create a new passphrase-protected ssh key credential object.

pub fn ssh_key_from_memory(
    username: &str,
    publickey: Option<&str>,
    privatekey: &str,
    passphrase: Option<&str>
) -> Result<Cred, Error>
[src]

Create a new ssh key credential object reading the keys from memory.

pub fn userpass_plaintext(username: &str, password: &str) -> Result<Cred, Error>[src]

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

pub fn credential_helper(
    config: &Config,
    url: &str,
    username: Option<&str>
) -> Result<Cred, Error>
[src]

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.

pub fn username(username: &str) -> Result<Cred, Error>[src]

Create a credential to specify a username.

This is used with ssh authentication to query for the username if none is specified in the url.

pub fn has_username(&self) -> bool[src]

Check whether a credential object contains username information.

pub fn credtype(&self) -> git_credtype_t[src]

Return the type of credentials that this object represents.

pub unsafe fn unwrap(self) -> *mut git_cred[src]

Unwrap access to the underlying raw pointer, canceling the destructor

Trait Implementations

impl Drop for Cred[src]

fn drop(&mut self)[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

impl RefUnwindSafe for Cred

impl !Send for Cred

impl !Sync for Cred

impl Unpin for Cred

impl UnwindSafe for Cred

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.