Module pastemyst::user[][src]

This is the user module which allows you to communicate with pastemyst's api to send GET requests to check if a user exists or not and GET user information.

API Docs

The relevent API documentation for this module is: https://paste.myst.rs/api-docs/user

Structs

UserObject

The user object that pastemyst provides. It has all the public details of a user.

Functions

get_user

Gets a user synchronously from pastemyst This information is stored in the UserObject struct. If a user does not exist, it will return nothing and emit a console log warning about the user not existing.

get_user_async

Gets a user asynchronously from pastemyst This information is stored in the UserObject struct. If a user does not exist, it will return nothing and emit a console log warning about the user not existing.

user_exists

Sends a request to pastemyst to check if a user exists. If a user does exist, it returns a value of 200 i.e, true else false. This methods runs synchronously.

user_exists_async

Sends a request to pastemyst to check if a user exists. If a user does exist, it returns a value of 200 i.e, true else false. This methods runs asynchronously.

Type Definitions

UserResult

The type provided by the pastemyst lib. It takes a type T and evalutates to that type and a Result like so: Result<T, E> where E has the default value of reqwest::Error. Keep note that E can be overriden.