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.
Auto Trait Implementations§
impl RefUnwindSafe for CredentialHelper
impl Send for CredentialHelper
impl Sync for CredentialHelper
impl Unpin for CredentialHelper
impl UnwindSafe for CredentialHelper
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more