pub struct Client {
pub url: String,
pub client: Client,
}
Expand description
Client for connecting to LessPass server
Fields§
§url: String
§client: Client
Implementations§
Source§impl Client
Builder interface to Client
impl Client
Builder interface to Client
Usage:
use lesspass_client::Client;
let url = "https://api.lesspass.com";
let lpc = Client::new(url);
Sourcepub async fn create_token(&self, email: &str, password: &str) -> Result<Token>
pub async fn create_token(&self, email: &str, password: &str) -> Result<Token>
Create a new token (perform initial auth with email and password)
Sourcepub async fn refresh_token(&self, token: &str) -> Result<Token>
pub async fn refresh_token(&self, token: &str) -> Result<Token>
Refresh a token
Need refresh token string
Sourcepub async fn get_user(&self, token: &str) -> Result<User>
pub async fn get_user(&self, token: &str) -> Result<User>
Gets current user info
Need access token string
Sourcepub async fn change_user_password(
&self,
token: &str,
current_password: &str,
new_password: &str,
) -> Result<()>
pub async fn change_user_password( &self, token: &str, current_password: &str, new_password: &str, ) -> Result<()>
Changes current user password
Need access token string
Sourcepub async fn delete_user(
&self,
token: &str,
current_password: &str,
) -> Result<()>
pub async fn delete_user( &self, token: &str, current_password: &str, ) -> Result<()>
Deletes current user
Need access token string
Sourcepub async fn get_passwords(&self, token: &str) -> Result<Passwords>
pub async fn get_passwords(&self, token: &str) -> Result<Passwords>
Gets the password list
Need access token string
Sourcepub async fn post_password(
&self,
token: &str,
password: &NewPassword,
) -> Result<()>
pub async fn post_password( &self, token: &str, password: &NewPassword, ) -> Result<()>
Creates a new password
Need access token string
Sourcepub async fn put_password(
&self,
token: &str,
id: &str,
password: &NewPassword,
) -> Result<()>
pub async fn put_password( &self, token: &str, id: &str, password: &NewPassword, ) -> Result<()>
Updates existing password
Need access token string
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Client
impl !RefUnwindSafe for Client
impl Send for Client
impl Sync for Client
impl Unpin for Client
impl !UnwindSafe for Client
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more