Trait 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 BuildInfo

Source§

impl Endpoint for DefaultSavePath

Source§

impl Endpoint for Preferences

Source§

impl Endpoint for SetPreferences

Source§

impl Endpoint for Shutdown

Source§

impl Endpoint for Version

Source§

impl Endpoint for WebApiVersion

Source§

impl Endpoint for Login

Source§

impl Endpoint for Logout

Source§

impl Endpoint for Main

Source§

impl Endpoint for Peers

Source§

impl Endpoint for qbit_api_rs::api::search::Delete

Source§

impl Endpoint for Results

Source§

impl Endpoint for Start

Source§

impl Endpoint for Status

Source§

impl Endpoint for Stop

Source§

impl Endpoint for Maindata

Source§

impl Endpoint for TorrentPeers

Source§

impl Endpoint for Add

Source§

impl Endpoint for AddPeers

Source§

impl Endpoint for AddTags

Source§

impl Endpoint for AddTrackers

Source§

impl Endpoint for BottomPrio

Source§

impl Endpoint for Categories

Source§

impl Endpoint for CreateCategory

Source§

impl Endpoint for CreateTags

Source§

impl Endpoint for DecreasePrio

Source§

impl Endpoint for qbit_api_rs::api::torrents::Delete

Source§

impl Endpoint for DeleteTags

Source§

impl Endpoint for qbit_api_rs::api::torrents::DownloadLimit

Source§

impl Endpoint for EditCategory

Source§

impl Endpoint for EditTracker

Source§

impl Endpoint for Files

Source§

impl Endpoint for IncreasePrio

Source§

impl Endpoint for qbit_api_rs::api::torrents::Info

Source§

impl Endpoint for Pause

Source§

impl Endpoint for PieceHashes

Source§

impl Endpoint for PieceStates

Source§

impl Endpoint for Properties

Source§

impl Endpoint for Reannounce

Source§

impl Endpoint for Recheck

Source§

impl Endpoint for RemoveCategories

Source§

impl Endpoint for RemoveTags

Source§

impl Endpoint for RemoveTrackers

Source§

impl Endpoint for Rename

Source§

impl Endpoint for RenameFile

Source§

impl Endpoint for RenameFolder

Source§

impl Endpoint for Resume

Source§

impl Endpoint for SetAutoManagement

Source§

impl Endpoint for SetCategory

Source§

impl Endpoint for qbit_api_rs::api::torrents::SetDownloadLimit

Source§

impl Endpoint for SetForceStart

Source§

impl Endpoint for SetLocation

Source§

impl Endpoint for SetShareLimits

Source§

impl Endpoint for SetSuperSeeding

Source§

impl Endpoint for qbit_api_rs::api::torrents::SetUploadLimit

Source§

impl Endpoint for Tags

Source§

impl Endpoint for ToggleFirstLastPiecePrio

Source§

impl Endpoint for ToggleSequentialDownload

Source§

impl Endpoint for TopPrio

Source§

impl Endpoint for Trackers

Source§

impl Endpoint for qbit_api_rs::api::torrents::UploadLimit

Source§

impl Endpoint for Webseeds

Source§

impl Endpoint for BanPeers

Source§

impl Endpoint for qbit_api_rs::api::transfer::DownloadLimit

Source§

impl Endpoint for qbit_api_rs::api::transfer::Info

Source§

impl Endpoint for qbit_api_rs::api::transfer::SetDownloadLimit

Source§

impl Endpoint for qbit_api_rs::api::transfer::SetUploadLimit

Source§

impl Endpoint for SpeedLimitsMode

Source§

impl Endpoint for ToggleSpeedLimitsMode

Source§

impl Endpoint for qbit_api_rs::api::transfer::UploadLimit