Module pastemyst::paste[][src]

The paste namespace which contains every method and struct to GET and POST (send) a paste to pastemyst.

API Docs

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

Structs

CreateObject

The structure object that holds the base to create a paste. This is then sent to pastemyst. All fields are optional except the pasties array which uses PastyObject.

EditHistory

Infomation about edits in a pasty in a paste.

EditObject

The same as CreateObject except that it does not have the expiresIn field which has been removed for convenience. This may change in the future, but for the current moment, this shall remain.

PasteObject

The paste object recieved when getting a paste. It contains both the PastyObject and EditHistory in an array.

PastyObject

Information about a specific pasty in a paste.

Functions

create_paste

Uses the CreateObject struct as a parameter for paste data to be constructed into json format and sent to pastemyst in a synchronous manner.

create_paste_async

Uses the CreateObject struct as a parameter for paste data to be constructed into json format and sent to pastemyst in an asynchronous manner.

create_private_paste

Uses the CreateObject and &str (auth_token) to send a paste to pastemyst held under your account which you can configure to be private/public or not. You also get the authority to delete that paste. This is a synchronous method.

create_private_paste_async

Uses the CreateObject struct and a &str authorization key as a parameter which you can get from user settings on pastemyst. This data is constructed into json format and sent to pastemyst in an asynchronous manner. The paste is send under the ownership of the account the auth key belongs to.

delete_paste

You can only delete pastes on your account, which means you must also provide the authorization key. This action is irreversible can the paste cannot be restored in any way. This methods sends the request synchronously.

delete_paste_async

You can only delete pastes on your account, which means you must also provide the authorization key. This action is irreversible can the paste cannot be restored in any way. This methods sends the request asynchronously.

edit_paste

Sends a request to pastemyst to edit a specific paste. You need to provide the EditObject struct i.e, whatever you want to edit. This is a synchronous method.

edit_paste_async

Sends a request to pastemyst to edit a specific paste. You need to provide the EditObject struct i.e, whatever you want to edit. This is a asynchronous method.

get_paste

Gets a paste's data in json format from pastemyst synchronously. It returns a Result with a PasteObject and error.

get_paste_async

Gets a paste's data in json format from pastemyst asynchronously. It returns a Result with a PasteObject and error.

get_private_paste

Gets a private paste's data in json format from pastemyst synchronously. It returns a Result with a PasteObject and error.

get_private_paste_async

Gets a private paste's data in json format from pastemyst asynchronously. It returns a Result with a PasteObject and error.

Type Definitions

PasteResult

The PasteResult type provided by this library for ease. It has a return value and error.