Struct habitica_rust_client::task::habitica_client::HabiticaClient[][src]

pub struct HabiticaClient { /* fields omitted */ }

Implementations

Creates a new HabiticaClient

Examples
extern crate habitica_rust_client;

use habitica_rust_client::task::api_credentials::ApiCredentials;
use habitica_rust_client::task::habitica_client::HabiticaClient;

let api_credentials = ApiCredentials::new("user_id".to_string(), "api_token".to_string());

HabiticaClient::new(api_credentials);

Returns all of users tasks (habits, dailies, to-dos)

Examples
extern crate habitica_rust_client;

use habitica_rust_client::task::api_credentials::ApiCredentials;
use habitica_rust_client::task::habitica_client::HabiticaClient;
use std::env;

let api_credentials = ApiCredentials::new(
       env::var("API_USER").unwrap().to_string(),
       env::var("API_KEY").unwrap().to_string(),
);

HabiticaClient::new(api_credentials).get_all_tasks();
Errors

If the REST call to Habitica Api does not succeed (status code diferrent from 200) it will return an error with a String that contains what happened

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more