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
impl !RefUnwindSafe for HabiticaClient
impl !Send for HabiticaClient
impl !Sync for HabiticaClient
impl Unpin for HabiticaClient
impl !UnwindSafe for HabiticaClient
Blanket Implementations
Mutably borrows from an owned value. Read more
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