Struct oxide_todo_sdk::Client
source · pub struct Client { /* private fields */ }
Expand description
A client for the server.
Implementations§
source§impl Client
impl Client
sourcepub async fn login(
&self,
username: impl AsRef<str>,
password: impl AsRef<str>
) -> OxideResult<User>
pub async fn login( &self, username: impl AsRef<str>, password: impl AsRef<str> ) -> OxideResult<User>
Login the user with username and password.
sourcepub async fn register(
&self,
username: impl AsRef<str>,
password: impl AsRef<str>
) -> OxideResult<User>
pub async fn register( &self, username: impl AsRef<str>, password: impl AsRef<str> ) -> OxideResult<User>
Register the user with username and password.
sourcepub fn login_by_token(&self, token: impl AsRef<str>) -> User
pub fn login_by_token(&self, token: impl AsRef<str>) -> User
Login the user by token. This will not make a request to the server. It will just create a new user with the given token.