Trait qbit_api_rs::api::Endpoint

source ·
pub trait Endpoint {
    type Query: Serialize;
    type Form: Serialize;
    type Response: DeserializeOwned;

    // Required methods
    fn relative_path(&self) -> Cow<'_, str>;
    fn check_status(&self, status: StatusCode) -> Option<ClientError>;
    fn de_response<'life0, 'async_trait>(
        &'life0 self,
        res: Response
    ) -> Pin<Box<dyn Future<Output = Result<Self::Response, ClientError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn query(&self) -> Option<&Self::Query> { ... }
    fn form(&self) -> Option<&Self::Form> { ... }
    fn multipart(&self) -> Option<Form> { ... }
    fn method(&self) -> Method { ... }
}

Required Associated Types§

source

type Query: Serialize

define type of query, form and response

source

type Form: Serialize

source

type Response: DeserializeOwned

Required Methods§

source

fn relative_path(&self) -> Cow<'_, str>

The endpoint relative path. Must start with a /

source

fn check_status(&self, status: StatusCode) -> Option<ClientError>

Check the status code

source

fn de_response<'life0, 'async_trait>( &'life0 self, res: Response ) -> Pin<Box<dyn Future<Output = Result<Self::Response, ClientError>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Deserialize the response

Provided Methods§

source

fn query(&self) -> Option<&Self::Query>

The query to be used when calling this endpoint.

source

fn form(&self) -> Option<&Self::Form>

The form body to be used when calling this endpoint.

source

fn multipart(&self) -> Option<Form>

The multipart to be used when calling this endpoint.

source

fn method(&self) -> Method

The request method of this endpoint. either POST or GET.

Implementors§

source§

impl Endpoint for AppBuildInfo

source§

impl Endpoint for AppDefaultSavePath

§

type Query = ()

§

type Form = ()

§

type Response = String

source§

impl Endpoint for AppPreferences

source§

impl Endpoint for AppSetPreferences

source§

impl Endpoint for AppShutdown

§

type Query = ()

§

type Form = ()

§

type Response = String

source§

impl Endpoint for AppVersion

§

type Query = ()

§

type Form = ()

§

type Response = String

source§

impl Endpoint for AppWebApiVersion

§

type Query = ()

§

type Form = ()

§

type Response = String

source§

impl Endpoint for AuthLogin

source§

impl Endpoint for AuthLogout

§

type Query = ()

§

type Form = ()

§

type Response = String

source§

impl Endpoint for BanPeers

source§

impl Endpoint for DownloadLimit

§

type Query = ()

§

type Form = ()

§

type Response = String

source§

impl Endpoint for LogMain

source§

impl Endpoint for LogPeers

source§

impl Endpoint for Maindata

source§

impl Endpoint for SetDownloadLimit

source§

impl Endpoint for SetUploadLimit

source§

impl Endpoint for SpeedLimitsMode

source§

impl Endpoint for ToggleSpeedLimitsMode

§

type Query = ()

§

type Form = ()

§

type Response = String

source§

impl Endpoint for TorrentPeers

source§

impl Endpoint for TorrentsAdd

§

type Query = ()

§

type Form = ()

§

type Response = String

source§

impl Endpoint for TorrentsAddPeers

source§

impl Endpoint for TorrentsAddTags

source§

impl Endpoint for TorrentsAddTrackers

source§

impl Endpoint for TorrentsBottomPrio

source§

impl Endpoint for TorrentsCategories

source§

impl Endpoint for TorrentsCreateCategory

source§

impl Endpoint for TorrentsCreateTags

source§

impl Endpoint for TorrentsDecreasePrio

source§

impl Endpoint for TorrentsDelete

source§

impl Endpoint for TorrentsDeleteTags

source§

impl Endpoint for TorrentsDownloadLimit

source§

impl Endpoint for TorrentsEditCategory

source§

impl Endpoint for TorrentsEditTracker

source§

impl Endpoint for TorrentsFiles

source§

impl Endpoint for TorrentsIncreasePrio

source§

impl Endpoint for TorrentsInfo

source§

impl Endpoint for TorrentsPause

source§

impl Endpoint for TorrentsPieceHashes

source§

impl Endpoint for TorrentsPieceStates

source§

impl Endpoint for TorrentsProperties

source§

impl Endpoint for TorrentsReannounce

source§

impl Endpoint for TorrentsRecheck

source§

impl Endpoint for TorrentsRemoveCategories

source§

impl Endpoint for TorrentsRemoveTags

source§

impl Endpoint for TorrentsRemoveTrackers

source§

impl Endpoint for TorrentsRename

source§

impl Endpoint for TorrentsRenameFile

source§

impl Endpoint for TorrentsRenameFolder

source§

impl Endpoint for TorrentsResume

source§

impl Endpoint for TorrentsSetAutoManagement

source§

impl Endpoint for TorrentsSetCategory

source§

impl Endpoint for TorrentsSetDownloadLimit

source§

impl Endpoint for TorrentsSetForceStart

source§

impl Endpoint for TorrentsSetLocation

source§

impl Endpoint for TorrentsSetShareLimits

source§

impl Endpoint for TorrentsSetSuperSeeding

source§

impl Endpoint for TorrentsSetUploadLimit

source§

impl Endpoint for TorrentsTags

source§

impl Endpoint for TorrentsToggleFirstLastPiecePrio

source§

impl Endpoint for TorrentsToggleSequentialDownload

source§

impl Endpoint for TorrentsTopPrio

source§

impl Endpoint for TorrentsTrackers

source§

impl Endpoint for TorrentsUploadLimit

source§

impl Endpoint for TorrentsWebseeds

source§

impl Endpoint for TransferInfo

source§

impl Endpoint for UploadLimit

§

type Query = ()

§

type Form = ()

§

type Response = String