[][src]Trait cargo_credential::Credential

pub trait Credential {
    pub fn name(&self) -> &'static str;
pub fn get(
        &self,
        registry_name: &str,
        api_url: &str
    ) -> Result<String, Error>;
pub fn store(
        &self,
        registry_name: &str,
        api_url: &str,
        token: &str
    ) -> Result<(), Error>;
pub fn erase(&self, registry_name: &str, api_url: &str) -> Result<(), Error>; }

Required methods

pub fn name(&self) -> &'static str[src]

Returns the name of this credential process.

pub fn get(&self, registry_name: &str, api_url: &str) -> Result<String, Error>[src]

Retrieves a token for the given registry.

pub fn store(
    &self,
    registry_name: &str,
    api_url: &str,
    token: &str
) -> Result<(), Error>
[src]

Stores the given token for the given registry.

pub fn erase(&self, registry_name: &str, api_url: &str) -> Result<(), Error>[src]

Removes the token for the given registry.

If the user is not logged in, this should print a message to stderr if possible indicating that the user is not currently logged in, and return Ok.

Loading content...

Implementors

Loading content...