Struct QbitClient

Source
pub struct QbitClient {
    pub host: Url,
    pub auth: Credential,
    pub client: Client,
    pub cookie_store: Arc<CookieStoreMutex>,
}

Fields§

§host: Url§auth: Credential§client: Client§cookie_store: Arc<CookieStoreMutex>

Implementations§

Source§

impl QbitClient

Source

pub fn new_with_user_pwd<U>( host: U, username: U, password: U, ) -> Result<Self, ClientError>
where U: AsRef<str>,

Source

pub fn new_from_env() -> Result<Self, ClientError>

Source

pub async fn _resp<E>(&self, endpoint: &E) -> Result<E::Response, ClientError>
where E: Endpoint,

Source

pub async fn auth_login(&self) -> Result<(), ClientError>

§/api/v2/auth/login
Source

pub async fn auth_logout(&self) -> Result<(), ClientError>

§/api/v2/auth/logout
Source

pub async fn app_version(&self) -> Result<String, ClientError>

§/api/v2/app/version
Source

pub async fn app_webapi_version(&self) -> Result<String, ClientError>

§/api/v2/app/webapiVersion
Source

pub async fn app_build_info(&self) -> Result<BuildInfoResponse, ClientError>

§/api/v2/app/buildInfo
Source

pub async fn app_shutdown(&self) -> Result<(), ClientError>

§/api/v2/app/shutdown
Source

pub async fn app_preferences(&self) -> Result<Preferences, ClientError>

§/api/v2/app/preferences
Source

pub async fn app_set_preferences( &self, f: &SetPreferencesForm, ) -> Result<(), ClientError>

§/api/v2/app/setPreferences
Source

pub async fn app_default_save_path(&self) -> Result<(), ClientError>

§/api/v2/app/defaultSavePath
Source

pub async fn log_main( &self, q: &MainQuery, ) -> Result<Vec<MainResponseItem>, ClientError>

§/api/v2/log/main
Source

pub async fn log_peers( &self, q: &PeersQuery, ) -> Result<Vec<PeersResponseItem>, ClientError>

§/api/v2/log/peers
Source

pub async fn sync_maindata( &self, q: &MaindataQuery, ) -> Result<MaindataResponse, ClientError>

§/api/v2/sync/maindata
Source

pub async fn sync_torrent_peers( &self, q: &TorrentPeersQuery, ) -> Result<TorrentPeersResponse, ClientError>

§/api/v2/sync/torrentPeers
Source

pub async fn transfer_info(&self) -> Result<InfoResponse, ClientError>

§/api/v2/transfer/info
Source

pub async fn speed_limits_mode( &self, ) -> Result<SpeedLimitsModeResponse, ClientError>

§/api/v2/transfer/speedLimitsMode
Source

pub async fn toggle_speed_limits_mode(&self) -> Result<(), ClientError>

§/api/v2/transfer/toggleSpeedLimitsMode
Source

pub async fn download_limit(&self) -> Result<u64, ClientError>

§/api/v2/transfer/downloadLimit
Source

pub async fn set_download_limit(&self, limit: u64) -> Result<(), ClientError>

§/api/v2/transfer/setDownloadLimit
Source

pub async fn upload_limit(&self) -> Result<u64, ClientError>

§/api/v2/transfer/uploadLimit
Source

pub async fn set_upload_limit(&self, limit: u64) -> Result<(), ClientError>

§/api/v2/transfer/setUploadLimit
Source

pub async fn ban_peers<T>(&self, peers: &[T]) -> Result<(), ClientError>
where T: AsRef<str>,

§/api/v2/transfer/banPeers
Source

pub async fn torrents_info( &self, q: &InfoQuery, ) -> Result<InfoResponse, ClientError>

§/api/v2/torrents/info
Source

pub async fn torrents_properties( &self, hash: &str, ) -> Result<PropertiesResponse, ClientError>

§/api/v2/torrents/properties
Source

pub async fn torrents_trackers( &self, hash: &str, ) -> Result<TrackersResponse, ClientError>

§/api/v2/torrents/trackers
Source

pub async fn torrents_webseeds( &self, hash: &str, ) -> Result<WebseedsResponse, ClientError>

§/api/v2/torrents/webseeds
Source

pub async fn torrents_files( &self, hash: &str, indexes: Option<&[u64]>, ) -> Result<FilesResponse, ClientError>

§/api/v2/torrents/files
Source

pub async fn torrents_piece_states( &self, hash: &str, ) -> Result<PieceStatesResponse, ClientError>

§/api/v2/torrents/pieceStates
Source

pub async fn torrents_piece_hashes( &self, hash: &str, ) -> Result<PieceHashesResponse, ClientError>

§/api/v2/torrents/pieceHashes
Source

pub async fn torrents_pause<T>(&self, hashes: &[T]) -> Result<(), ClientError>
where T: AsRef<str>,

§/api/v2/torrents/pause
Source

pub async fn torrents_resume<T>(&self, hashes: &[T]) -> Result<(), ClientError>
where T: AsRef<str>,

§/api/v2/torrents/resume
Source

pub async fn torrents_delete<T>( &self, hashes: &[T], delete_files: bool, ) -> Result<(), ClientError>
where T: AsRef<str>,

§/api/v2/torrents/delete
Source

pub async fn torrents_recheck<H>(&self, hashes: &[H]) -> Result<(), ClientError>
where H: AsRef<str>,

§/api/v2/torrents/recheck
Source

pub async fn torrents_reannounce<H>( &self, hashes: &[H], ) -> Result<(), ClientError>
where H: AsRef<str>,

§/api/v2/torrents/reannounce
Source

pub async fn torrents_add_by_url<U>( &self, urls: &[U], ) -> Result<(), ClientError>
where U: AsRef<str>,

§/api/v2/torrents/add
Source

pub async fn torrents_add_by_file<F>( &self, files: &[F], ) -> Result<(), ClientError>
where F: AsRef<Path>,

§/api/v2/torrents/add
Source

pub async fn torrents_add_trackers<H, U>( &self, hash: H, urls: &[U], ) -> Result<(), ClientError>
where H: AsRef<str>, U: AsRef<str>,

§/api/v2/torrents/addTrackers
Source

pub async fn torrents_edit_tracker<H, U>( &self, hash: H, orig_url: U, new_url: U, ) -> Result<(), ClientError>
where H: AsRef<str>, U: AsRef<str>,

§/api/v2/torrents/editTracker
Source

pub async fn torrents_remove_trackers<H, U>( &self, hash: H, urls: &[U], ) -> Result<(), ClientError>
where H: AsRef<str>, U: AsRef<str>,

§/api/v2/torrents/removeTrackers
Source

pub async fn torrents_add_peers<H, P>( &self, hashes: &[H], peers: &[P], ) -> Result<(), ClientError>
where H: AsRef<str>, P: AsRef<str>,

§/api/v2/torrents/addPeers
Source

pub async fn torrents_increase_prio<H>( &self, hashes: &[H], ) -> Result<(), ClientError>
where H: AsRef<str>,

§/api/v2/torrents/increasePrio
Source

pub async fn torrents_decrease_prio<H>( &self, hashes: &[H], ) -> Result<(), ClientError>
where H: AsRef<str>,

§/api/v2/torrents/decreasePrio
Source

pub async fn torrents_top_prio<H>( &self, hashes: &[H], ) -> Result<(), ClientError>
where H: AsRef<str>,

§/api/v2/torrents/topPrio
Source

pub async fn torrents_bottom_prio<H>( &self, hashes: &[H], ) -> Result<(), ClientError>
where H: AsRef<str>,

§/api/v2/torrents/bottomPrio
Source

pub async fn torrents_download_limit<H>( &self, hashes: &[H], ) -> Result<DownloadLimitResponse, ClientError>
where H: AsRef<str>,

§/api/v2/torrents/filePrio
§/api/v2/torrents/downloadLimit
Source

pub async fn torrents_set_download_limit<H>( &self, hashes: &[H], limit: u64, ) -> Result<(), ClientError>
where H: AsRef<str>,

§/api/v2/torrents/setDownloadLimit
Source

pub async fn torrents_set_share_limits<H>( &self, hashes: &[H], ratio_limit: RatioLimit, seeding_time_limit: i64, ) -> Result<(), ClientError>
where H: AsRef<str>,

§/api/v2/torrents/setShareLimits
Source

pub async fn torrents_upload_limit<H>( &self, hashes: &[H], ) -> Result<UploadLimitResponse, ClientError>
where H: AsRef<str>,

§/api/v2/torrents/uploadLimit
Source

pub async fn torrents_set_upload_limit<H>( &self, hashes: &[H], limit: u64, ) -> Result<(), ClientError>
where H: AsRef<str>,

§/api/v2/torrents/setUploadLimit
Source

pub async fn torrents_set_location<H, L>( &self, hashes: &[H], location: L, ) -> Result<(), ClientError>
where H: AsRef<str>, L: AsRef<Path>,

§/api/v2/torrents/setLocation
Source

pub async fn torernts_rename<H, N>( &self, hash: H, name: N, ) -> Result<(), ClientError>
where H: AsRef<str>, N: AsRef<str>,

§/api/v2/torrents/rename
Source

pub async fn torernts_set_category<H, C>( &self, hashes: &[H], category: C, ) -> Result<(), ClientError>
where H: AsRef<str>, C: AsRef<str>,

§/api/v2/torrents/setCategory
Source

pub async fn torrents_categories( &self, ) -> Result<CategoriesResponse, ClientError>

§/api/v2/torrents/categories
Source

pub async fn torrents_create_category<C, P>( &self, category: C, save_path: P, ) -> Result<(), ClientError>
where C: AsRef<str>, P: AsRef<Path>,

§/api/v2/torrents/createCategory
Source

pub async fn torrents_edit_category<C, P>( &self, category: C, save_path: P, ) -> Result<(), ClientError>
where C: AsRef<str>, P: AsRef<Path>,

§/api/v2/torrents/editCategory
Source

pub async fn torrents_remove_categories<C>( &self, categories: &[C], ) -> Result<(), ClientError>
where C: AsRef<str>,

§/api/v2/torrents/removeCategories
Source

pub async fn torrents_add_tags<H, T>( &self, hashes: &[H], tags: &[T], ) -> Result<(), ClientError>
where H: AsRef<str>, T: AsRef<str>,

§/api/v2/torrents/addTags
Source

pub async fn torrents_remove_tags<H, T>( &self, hashes: &[H], tags: &[T], ) -> Result<(), ClientError>
where H: AsRef<str>, T: AsRef<str>,

§/api/v2/torrents/removeTags
Source

pub async fn torrents_tags(&self) -> Result<TagsResponse, ClientError>

§/api/v2/torrents/tags
Source

pub async fn torrens_create_tags<T>( &self, tags: &[T], ) -> Result<(), ClientError>
where T: AsRef<str>,

§/api/v2/torrents/createTags
Source

pub async fn torrents_delete_tags<T>( &self, tags: &[T], ) -> Result<(), ClientError>
where T: AsRef<str>,

§/api/v2/torrents/deleteTags
Source

pub async fn torrents_set_auto_management<H>( &self, hashes: &[H], enable: bool, ) -> Result<(), ClientError>
where H: AsRef<str>,

§/api/v2/torrents/setAutoManagement
Source

pub async fn torrents_toggle_sequential_download<H>( &self, hashes: &[H], ) -> Result<(), ClientError>
where H: AsRef<str>,

§/api/v2/torrents/toggleSequentialDownload
Source

pub async fn torrents_toggle_first_last_piece_prio<H>( &self, hashes: &[H], ) -> Result<(), ClientError>
where H: AsRef<str>,

§/api/v2/torrents/toggleFirstLastPiecePrio
Source

pub async fn torrents_set_force_start<H>( &self, hashes: &[H], value: bool, ) -> Result<(), ClientError>
where H: AsRef<str>,

§/api/v2/torrents/setForceStart
Source

pub async fn torrents_set_super_seeding<H>( &self, hashes: &[H], value: bool, ) -> Result<(), ClientError>
where H: AsRef<str>,

§/api/v2/torrents/setSuperSeeding
Source

pub async fn torrents_rename_file<H, P>( &self, hash: H, old_path: P, new_path: P, ) -> Result<(), ClientError>
where H: AsRef<str>, P: AsRef<Path>,

§/api/v2/torrents/renameFile
Source

pub async fn torrents_rename_folder<H, P>( &self, hash: H, old_path: P, new_path: P, ) -> Result<(), ClientError>
where H: AsRef<str>, P: AsRef<Path>,

§/api/v2/torrents/renameFolder
Source

pub async fn search_start<T>( &self, pattern: T, plugins: T, category: T, ) -> Result<StartResponse, ClientError>
where T: AsRef<str>,

§/api/v2/search/start
Source

pub async fn search_stop(&self, id: u64) -> Result<(), ClientError>

§/api/v2/search/stop
Source

pub async fn search_status( &self, id: Option<u64>, ) -> Result<StatusResponse, ClientError>

§/api/v2/search/status
Source

pub async fn search_results( &self, id: u64, limit: Option<i64>, offset: Option<i64>, ) -> Result<ResultsResponse, ClientError>

§/api/v2/search/results

Trait Implementations§

Source§

impl Debug for QbitClient

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T