Struct git2::CredentialHelper
source · pub struct CredentialHelper {
pub username: Option<String>,
/* private fields */
}
Expand description
Management of the gitcredentials(7) interface.
Fields§
§username: Option<String>
A public field representing the currently discovered username from configuration.
Implementations§
source§impl CredentialHelper
impl CredentialHelper
sourcepub fn new(url: &str) -> CredentialHelper
pub fn new(url: &str) -> CredentialHelper
Create a new credential helper object which will be used to probe git’s local credential configuration.
The url specified is the namespace on which this will query credentials. Invalid urls are currently ignored.
sourcepub fn username(&mut self, username: Option<&str>) -> &mut CredentialHelper
pub fn username(&mut self, username: Option<&str>) -> &mut CredentialHelper
Set the username that this credential helper will query with.
By default the username is None
.
sourcepub fn config(&mut self, config: &Config) -> &mut CredentialHelper
pub fn config(&mut self, config: &Config) -> &mut CredentialHelper
Query the specified configuration object to discover commands to execute, usernames to query, etc.