Struct lesspass_client::Client
source · pub struct Client {
pub host: Url,
pub client: Client,
}
Expand description
Client for connecting to LessPass server
Fields§
§host: Url
§client: Client
Implementations§
source§impl Client
impl Client
Builder interface to Client
Usage:
use reqwest::Url;
use lesspass_client::Client;
let host = Url::parse("https://api.lesspass.com").unwrap();
let lpc = Client::new(host);
sourcepub async fn create_user(
&self,
email: String,
password: String
) -> Result<(), String>
pub async fn create_user( &self, email: String, password: String ) -> Result<(), String>
Creates a new user
sourcepub async fn change_user_password(
&self,
token: String,
current_password: String,
new_password: String
) -> Result<(), String>
pub async fn change_user_password( &self, token: String, current_password: String, new_password: String ) -> Result<(), String>
Changes current user password
Need access token string
sourcepub async fn create_token(
&self,
email: String,
password: String
) -> Result<Token, String>
pub async fn create_token( &self, email: String, password: String ) -> Result<Token, String>
Create a new token (perform initial auth with username and password)
sourcepub async fn refresh_token(&self, token: String) -> Result<Token, String>
pub async fn refresh_token(&self, token: String) -> Result<Token, String>
Refresh a token
Need refresh token string
sourcepub async fn get_passwords(&self, token: String) -> Result<Passwords, String>
pub async fn get_passwords(&self, token: String) -> Result<Passwords, String>
Gets the password list
Need access token string
sourcepub async fn post_password(
&self,
token: String,
password: &NewPassword
) -> Result<(), String>
pub async fn post_password( &self, token: String, password: &NewPassword ) -> Result<(), String>
Creates a new password
Need access token string
sourcepub async fn put_password(
&self,
token: String,
id: String,
password: &NewPassword
) -> Result<(), String>
pub async fn put_password( &self, token: String, id: String, password: &NewPassword ) -> Result<(), String>
Updates existing password
Need access token string