Struct pixelast::PixelaClient [−][src]
pub struct PixelaClient { /* fields omitted */ }
A PixelaClient
to request to Pixela with.
Methods
impl PixelaClient
[src]
impl PixelaClient
pub fn new(username: &str, token: &str) -> Self
[src]
pub fn new(username: &str, token: &str) -> Self
Constructs a new PixelaClient
.
This method does not verify authentication.
pub fn create_new_user(
username: &str,
token: &str,
agree_terms_of_service: ConsentAnswer,
not_minor: ConsentAnswer
) -> Result<(), Error>
[src]
pub fn create_new_user(
username: &str,
token: &str,
agree_terms_of_service: ConsentAnswer,
not_minor: ConsentAnswer
) -> Result<(), Error>
pub fn update_user_token(&self, new_token: &str) -> Result<(), Error>
[src]
pub fn update_user_token(&self, new_token: &str) -> Result<(), Error>
Updates the authentication token for the specified user.
Errors
This method fails when request not success in Pixela.
pub fn delete_user(&self) -> Result<(), Error>
[src]
pub fn delete_user(&self) -> Result<(), Error>
pub fn create_graph(
&self,
id: &str,
name: &str,
unit: &str,
graph_type: GraphType,
color: GraphColor
) -> Result<(), Error>
[src]
pub fn create_graph(
&self,
id: &str,
name: &str,
unit: &str,
graph_type: GraphType,
color: GraphColor
) -> Result<(), Error>
Create a new pixelation graph definition.
Errors
This method fails when request not success in Pixela.
pub fn get_graphs(&self) -> Result<Vec<Graph>, Error>
[src]
pub fn get_graphs(&self) -> Result<Vec<Graph>, Error>
Get all predefined pixelation graph definitions.
Errors
This method fails when request not success in Pixela.
pub fn get_graph_svg(
&self,
graph_id: &str,
date: Option<&str>
) -> Result<String, Error>
[src]
pub fn get_graph_svg(
&self,
graph_id: &str,
date: Option<&str>
) -> Result<String, Error>
Based on the registered information, express the graph in SVG format diagram.
Errors
This method fails when request not success in Pixela.
pub fn update_graph(
&self,
graph_id: &str,
name: &str,
unit: &str,
color: GraphColor
) -> Result<(), Error>
[src]
pub fn update_graph(
&self,
graph_id: &str,
name: &str,
unit: &str,
color: GraphColor
) -> Result<(), Error>
Update predefined pixelation graph definitions. The items that can be updated are limited as compared with the pixelation graph definition creation.
Errors
This method fails when request not success in Pixela.
pub fn delete_graph(&self, graph_id: &str) -> Result<(), Error>
[src]
pub fn delete_graph(&self, graph_id: &str) -> Result<(), Error>
Delete the predefined pixelation graph definition.
Errors
This method fails when request not success in Pixela.
pub fn record_pixel(
&self,
graph_id: &str,
date: &str,
quantity: &str
) -> Result<(), Error>
[src]
pub fn record_pixel(
&self,
graph_id: &str,
date: &str,
quantity: &str
) -> Result<(), Error>
It records the quantity of the specified date as a "Pixel".
Errors
This method fails when request not success in Pixela.
pub fn get_pixel(&self, graph_id: &str, date: &str) -> Result<Pixel, Error>
[src]
pub fn get_pixel(&self, graph_id: &str, date: &str) -> Result<Pixel, Error>
pub fn update_pixel(
&self,
graph_id: &str,
date: &str,
quantity: &str
) -> Result<(), Error>
[src]
pub fn update_pixel(
&self,
graph_id: &str,
date: &str,
quantity: &str
) -> Result<(), Error>
Update the quantity already registered as a "Pixel".
Errors
This method fails when request not success in Pixela.
pub fn delete_pixel(&self, graph_id: &str, date: &str) -> Result<(), Error>
[src]
pub fn delete_pixel(&self, graph_id: &str, date: &str) -> Result<(), Error>
pub fn increment(&self, graph_id: &str) -> Result<(), Error>
[src]
pub fn increment(&self, graph_id: &str) -> Result<(), Error>
Increment quantity "Pixel" of the day (UTC). If the graph type is int then 1 added, and for float then 0.01 added.
Errors
This method fails when request not success in Pixela.
pub fn decrement(&self, graph_id: &str) -> Result<(), Error>
[src]
pub fn decrement(&self, graph_id: &str) -> Result<(), Error>
Decrement quantity "Pixel" of the day (UTC). If the graph type is int then -1 added, and for float then -0.01 added.
Errors
This method fails when request not success in Pixela.
Auto Trait Implementations
impl Send for PixelaClient
impl Send for PixelaClient
impl Sync for PixelaClient
impl Sync for PixelaClient