InnerClient

Struct InnerClient 

Source
pub struct InnerClient { /* private fields */ }

Implementations§

Source§

impl InnerClient

Source

pub async fn call( &self, id: i32, method: &str, params: Vec<Value>, ) -> Result<(), Error>

Send a rpc request to websocket without waiting for response.

Source

pub async fn call_and_wait<T>( &self, method: &str, params: Vec<Value>, ) -> Result<T, Error>

Send a rpc request to websocket and wait for corresponding response.

Source

pub fn subscribe_notifications(&self) -> Receiver<Notification>

Subscribe to notifications.

Returns a instance of broadcast::Receiver which can be used to receive notifications.

Source§

impl InnerClient

Source

pub async fn get_version(&self) -> Result<Version, Error>

Source

pub async fn remove(&self, gid: &str) -> Result<(), Error>

Source

pub async fn force_remove(&self, gid: &str) -> Result<(), Error>

Source

pub async fn pause(&self, gid: &str) -> Result<(), Error>

Source

pub async fn pause_all(&self) -> Result<(), Error>

Source

pub async fn force_pause(&self, gid: &str) -> Result<(), Error>

Source

pub async fn force_pause_all(&self) -> Result<(), Error>

Source

pub async fn unpause(&self, gid: &str) -> Result<(), Error>

Source

pub async fn unpause_all(&self) -> Result<(), Error>

Source

pub async fn custom_tell_status( &self, gid: &str, keys: Option<Vec<String>>, ) -> Result<Map<String, Value>, Error>

Source

pub async fn tell_status(&self, gid: &str) -> Result<Status, Error>

Source

pub async fn get_uris(&self, gid: &str) -> Result<Vec<Uri>, Error>

Source

pub async fn get_files(&self, gid: &str) -> Result<Vec<File>, Error>

Source

pub async fn get_peers(&self, gid: &str) -> Result<Vec<Peer>, Error>

Source

pub async fn get_servers( &self, gid: &str, ) -> Result<Vec<GetServersResult>, Error>

Source

pub async fn tell_active(&self) -> Result<Vec<Status>, Error>

Source

pub async fn tell_waiting( &self, offset: i32, num: i32, ) -> Result<Vec<Status>, Error>

Source

pub async fn tell_stopped( &self, offset: i32, num: i32, ) -> Result<Vec<Status>, Error>

Source

pub async fn custom_tell_active( &self, keys: Option<Vec<String>>, ) -> Result<Vec<Map<String, Value>>, Error>

Source

pub async fn custom_tell_waiting( &self, offset: i32, num: i32, keys: Option<Vec<String>>, ) -> Result<Vec<Map<String, Value>>, Error>

Source

pub async fn custom_tell_stopped( &self, offset: i32, num: i32, keys: Option<Vec<String>>, ) -> Result<Vec<Map<String, Value>>, Error>

Source

pub async fn change_position( &self, gid: &str, pos: i32, how: PositionHow, ) -> Result<i32, Error>

Source

pub async fn change_uri( &self, gid: &str, file_index: i32, del_uris: Vec<String>, add_uris: Vec<String>, position: Option<i32>, ) -> Result<(i32, i32), Error>

§Returns

This method returns a list which contains two integers.

The first integer is the number of URIs deleted. The second integer is the number of URIs added.

Source

pub async fn get_option(&self, gid: &str) -> Result<TaskOptions, Error>

Source

pub async fn change_option( &self, gid: &str, options: TaskOptions, ) -> Result<(), Error>

Source

pub async fn get_global_option(&self) -> Result<TaskOptions, Error>

Source

pub async fn change_global_option( &self, options: TaskOptions, ) -> Result<(), Error>

Source

pub async fn get_global_stat(&self) -> Result<GlobalStat, Error>

Source

pub async fn purge_download_result(&self) -> Result<(), Error>

Source

pub async fn remove_download_result(&self, gid: &str) -> Result<(), Error>

Source

pub async fn get_session_info(&self) -> Result<SessionInfo, Error>

Source

pub async fn shutdown(&self) -> Result<(), Error>

Source

pub async fn force_shutdown(&self) -> Result<(), Error>

Source

pub async fn save_session(&self) -> Result<(), Error>

Trait Implementations§

Source§

impl Drop for InnerClient

Source§

fn drop(&mut self)

Executes the destructor for this type. 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, 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> Same for T

Source§

type Output = T

Should always be Self
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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V