Crate b2creds

Crate b2creds 

Source
Expand description

This crate contains the logic to read B2 credentials following the same logic used by the B2 CLI.

let creds = b2creds::Credentials::locate().unwrap();
println!("Key ID: {} Key: {}", creds.application_key_id, creds.application_key);

Look at the Credentials::locate, Credentials::from_env. and Credentials::from_file to understand how to parse B2 credentials.

Structs§

Credentials
Holds the application key id and application key which make up your credentials

Enums§

CredentialsError
Error enum for crate functions. Used for all Result returns as the error enum.

Functions§

default_creds_file
Returns the default credentials file path.