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

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

Enums

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

Functions