pub struct NetrcCredentialHelper { /* private fields */ }Expand description
Netrc-backed credential helper.
Cheap to construct: the file is read and parsed once at construction, and lookups walk the parsed list linearly (netrc files are small in practice).
Implementations§
Source§impl NetrcCredentialHelper
impl NetrcCredentialHelper
Sourcepub fn from_contents(content: &str) -> Self
pub fn from_contents(content: &str) -> Self
Build from a parsed-and-already-decoded netrc body.
Sourcepub fn from_default_location() -> Option<Self>
pub fn from_default_location() -> Option<Self>
Read the user’s default netrc file.
Tries $HOME/.netrc, falling back to $HOME/_netrc on
Windows when .netrc isn’t present. Returns None when no
netrc file exists, when $HOME isn’t set, or when the file
is unreadable; these are not user errors, just “no creds from
this source”.
Trait Implementations§
Source§impl Debug for NetrcCredentialHelper
impl Debug for NetrcCredentialHelper
Source§impl Helper for NetrcCredentialHelper
impl Helper for NetrcCredentialHelper
Source§fn fill(&self, query: &Query) -> Result<Option<Credentials>, HelperError>
fn fill(&self, query: &Query) -> Result<Option<Credentials>, HelperError>
Try to fetch credentials for
query. Read moreSource§fn approve(&self, query: &Query, creds: &Credentials) -> Result<(), HelperError>
fn approve(&self, query: &Query, creds: &Credentials) -> Result<(), HelperError>
Source§fn reject(&self, query: &Query, creds: &Credentials) -> Result<(), HelperError>
fn reject(&self, query: &Query, creds: &Credentials) -> Result<(), HelperError>
Auto Trait Implementations§
impl !Freeze for NetrcCredentialHelper
impl RefUnwindSafe for NetrcCredentialHelper
impl Send for NetrcCredentialHelper
impl Sync for NetrcCredentialHelper
impl Unpin for NetrcCredentialHelper
impl UnsafeUnpin for NetrcCredentialHelper
impl UnwindSafe for NetrcCredentialHelper
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