[][src]Struct credent_fs::CredentialsFileLoader

pub struct CredentialsFileLoader;

Reads credentials from the user's configuration directory.

Implementations

impl CredentialsFileLoader[src]

pub async fn load<'_>(app_name: AppName<'_>) -> Result<Option<Profile>, Error>[src]

Returns the default profile credentials stored in the user's configuration directory.

The path differs depending on the user's operating system:

  • Windows: C:\Users\%USER%\AppData\Roaming\<app>\credentials
  • Linux: $XDG_CONFIG_HOME or $HOME/.config/<app>/credentials
  • OS X: $HOME/Library/Application Support/<app>/credentials

Parameters

  • app_name: Name of the application whose credentials to load.

pub async fn load_profile<'_, '_>(
    app_name: AppName<'_>,
    profile_name: &'_ str
) -> Result<Option<Profile>, Error>
[src]

Returns the profile credentials stored in the user's configuration directory.

The path differs depending on the user's operating system:

  • Windows: C:\Users\%USER%\AppData\Roaming\<app>\credentials
  • Linux: $XDG_CONFIG_HOME or $HOME/.config/<app>/credentials
  • OS X: $HOME/Library/Application Support/<app>/credentials

Parameters

  • app_name: Name of the application whose credentials to load.
  • profile_name: Which profile's credentials to load.

pub async fn load_all<'_>(
    app_name: AppName<'_>
) -> Result<Option<Profiles>, Error>
[src]

Returns all profile credentials stored in the user's configuration directory.

The path differs depending on the user's operating system:

  • Windows: C:\Users\%USER%\AppData\Roaming\<app>\credentials
  • Linux: $XDG_CONFIG_HOME or $HOME/.config/<app>/credentials
  • OS X: $HOME/Library/Application Support/<app>/credentials

Parameters

  • app_name: Name of the application whose credentials to load.

pub async fn load_file<'_>(
    credentials_path: &'_ Path
) -> Result<Profiles, Error>
[src]

Loads all credential profiles from the given file.

Parameters

  • credentials_path: File to load credentials from.

Trait Implementations

impl Debug for CredentialsFileLoader[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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

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

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.

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.