pub struct Callbacks {
pub on_download_complete: Option<BoxFuture<'static, ()>>,
pub on_error: Option<BoxFuture<'static, ()>>,
}Expand description
Callbacks that will be executed on notifications.
If the connection lost, all callbacks will be checked whether they need to be executed once reconnected.
It executes at most once for each task. That means a task can either be completed or failed.
If you need to customize the behavior, you can use Client::subscribe_notifications
to receive notifications and handle them yourself,
or use tell_status to check the status of the task.
Fields§
§on_download_complete: Option<BoxFuture<'static, ()>>Will trigger on Event::Complete or Event::BtComplete.
on_error: Option<BoxFuture<'static, ()>>Will trigger on Event::Error.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Callbacks
impl !RefUnwindSafe for Callbacks
impl Send for Callbacks
impl !Sync for Callbacks
impl Unpin for Callbacks
impl !UnwindSafe for Callbacks
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