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

Methods

impl B2Credentials
[src]

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]

Formats the value using the given formatter.

impl Clone for B2Credentials
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl HeaderFormat for B2Credentials
[src]

Format a header to be output into a TcpStream. Read more

impl Header for B2Credentials
[src]

Returns the name of the header field this belongs to. Read more

Parse a header from a raw stream of bytes. Read more