Struct backblaze_b2::raw::authorize::B2Credentials
[−]
[src]
pub struct B2Credentials { pub id: String, pub key: String, }
Contains the backblaze id and key needed to authorize access to the backblaze b2 api. This struct derives Deserialize, so a simple way to read this from a file would be:
extern crate serde; extern crate serde_json; use std::fs::File; serde_json::from_reader::<_,B2Credentials>(File::open("credentials.txt").unwrap()).unwrap();
Fields
id: String
key: String
Methods
impl B2Credentials
[src]
fn auth_string(&self) -> String
This function returns the value of the Authorization header needed to perform a b2_authorize_account api call.
This function performs a b2_authorize_account api call to the backblaze api and returns an authorization token.
Errors
This function returns a B2Error
in case something goes wrong. Besides the standard
non-authorization errors, this function can fail with is_credentials_issue
.
Trait Implementations
impl Debug for B2Credentials
[src]
impl Clone for B2Credentials
[src]
fn clone(&self) -> B2Credentials
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl HeaderFormat for B2Credentials
[src]
fn fmt_header(&self, f: &mut Formatter) -> Result
Format a header to be output into a TcpStream. Read more
impl Header for B2Credentials
[src]
fn header_name() -> &'static str
Returns the name of the header field this belongs to. Read more
fn parse_header(raw: &[Vec<u8>]) -> Result<B2Credentials>
Parse a header from a raw stream of bytes. Read more