pub struct InnerClient { /* private fields */ }Implementations§
Source§impl InnerClient
impl InnerClient
Sourcepub async fn call(
&self,
id: i32,
method: &str,
params: Vec<Value>,
) -> Result<(), Error>
pub async fn call( &self, id: i32, method: &str, params: Vec<Value>, ) -> Result<(), Error>
Send a rpc request to websocket without waiting for response.
Sourcepub async fn call_and_wait<T>(
&self,
method: &str,
params: Vec<Value>,
) -> Result<T, Error>where
T: DeserializeOwned + Send,
pub async fn call_and_wait<T>(
&self,
method: &str,
params: Vec<Value>,
) -> Result<T, Error>where
T: DeserializeOwned + Send,
Send a rpc request to websocket and wait for corresponding response.
Sourcepub fn subscribe_notifications(&self) -> Receiver<Notification>
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
impl InnerClient
pub async fn get_version(&self) -> Result<Version, Error>
pub async fn remove(&self, gid: &str) -> Result<(), Error>
pub async fn force_remove(&self, gid: &str) -> Result<(), Error>
pub async fn pause(&self, gid: &str) -> Result<(), Error>
pub async fn pause_all(&self) -> Result<(), Error>
pub async fn force_pause(&self, gid: &str) -> Result<(), Error>
pub async fn force_pause_all(&self) -> Result<(), Error>
pub async fn unpause(&self, gid: &str) -> Result<(), Error>
pub async fn unpause_all(&self) -> Result<(), Error>
pub async fn custom_tell_status( &self, gid: &str, keys: Option<Vec<String>>, ) -> Result<Map<String, Value>, Error>
pub async fn tell_status(&self, gid: &str) -> Result<Status, Error>
pub async fn get_uris(&self, gid: &str) -> Result<Vec<Uri>, Error>
pub async fn get_files(&self, gid: &str) -> Result<Vec<File>, Error>
pub async fn get_peers(&self, gid: &str) -> Result<Vec<Peer>, Error>
pub async fn get_servers( &self, gid: &str, ) -> Result<Vec<GetServersResult>, Error>
pub async fn tell_active(&self) -> Result<Vec<Status>, Error>
pub async fn tell_waiting( &self, offset: i32, num: i32, ) -> Result<Vec<Status>, Error>
pub async fn tell_stopped( &self, offset: i32, num: i32, ) -> Result<Vec<Status>, Error>
pub async fn custom_tell_active( &self, keys: Option<Vec<String>>, ) -> Result<Vec<Map<String, Value>>, Error>
pub async fn custom_tell_waiting( &self, offset: i32, num: i32, keys: Option<Vec<String>>, ) -> Result<Vec<Map<String, Value>>, Error>
pub async fn custom_tell_stopped( &self, offset: i32, num: i32, keys: Option<Vec<String>>, ) -> Result<Vec<Map<String, Value>>, Error>
pub async fn change_position( &self, gid: &str, pos: i32, how: PositionHow, ) -> Result<i32, Error>
Sourcepub 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>
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.
pub async fn get_option(&self, gid: &str) -> Result<TaskOptions, Error>
pub async fn change_option( &self, gid: &str, options: TaskOptions, ) -> Result<(), Error>
pub async fn get_global_option(&self) -> Result<TaskOptions, Error>
pub async fn change_global_option( &self, options: TaskOptions, ) -> Result<(), Error>
pub async fn get_global_stat(&self) -> Result<GlobalStat, Error>
pub async fn purge_download_result(&self) -> Result<(), Error>
pub async fn remove_download_result(&self, gid: &str) -> Result<(), Error>
pub async fn get_session_info(&self) -> Result<SessionInfo, Error>
pub async fn shutdown(&self) -> Result<(), Error>
pub async fn force_shutdown(&self) -> Result<(), Error>
pub async fn save_session(&self) -> Result<(), Error>
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for InnerClient
impl RefUnwindSafe for InnerClient
impl Send for InnerClient
impl Sync for InnerClient
impl Unpin for InnerClient
impl UnwindSafe for InnerClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more