Struct rustube::Callback [−][src]
callback
only.Methods and streams to process either on_progress or on_complete
Fields
on_progress: OnProgressType
on_complete: OnCompleteType
Implementations
impl Callback
[src]
pub fn new() -> Self
[src]
stream
only.Create a new callback struct without actual callbacks
pub fn connect_on_progress_closure(
self,
closure: impl Fn(CallbackArguments) + 'static
) -> Self
[src]
self,
closure: impl Fn(CallbackArguments) + 'static
) -> Self
stream
only.Attach a closure to be executed on progress
Warning:
This closure gets executed quite often, once every ~10kB progress. If it’s too slow, some on_progress events will be dropped. If you are looking fore something that will be executed more seldom, look for Callback::connect_on_progress_closure_slow
pub fn connect_on_progress_closure_slow(
self,
closure: impl Fn(CallbackArguments) + 'static
) -> Self
[src]
self,
closure: impl Fn(CallbackArguments) + 'static
) -> Self
stream
only.Attach a closure to be executed on progress. This closure will be executed more seldom, around once for every MB downloaded.
pub fn connect_on_progress_closure_async<Fut: Future<Output = ()> + Send + 'static, F: Fn(CallbackArguments) -> Fut + 'static>(
self,
closure: F
) -> Self
[src]
self,
closure: F
) -> Self
stream
only.Attach a async closure to be executed on progress
Warning:
This closure gets executed quite often, once every ~10kB progress. If it’s too slow, some on_progress events will be dropped. If you are looking fore something that will be executed more seldom, look for Callback::connect_on_progress_closure_async_slow
pub fn connect_on_progress_closure_async_slow<Fut: Future<Output = ()> + Send + 'static, F: Fn(CallbackArguments) -> Fut + 'static + Sync + Send>(
self,
closure: F
) -> Self
[src]
self,
closure: F
) -> Self
stream
only.Attach a async closure to be executed on progress. This closure will be executed more seldom, around once for every MB downloaded.
pub fn connect_on_progress_sender(
self,
sender: Sender<CallbackArguments>,
cancel_on_close: bool
) -> Self
[src]
self,
sender: Sender<CallbackArguments>,
cancel_on_close: bool
) -> Self
stream
only.Attach a bounded sender that receives messages on progress cancel_or_close indicates whether or not to cancel the download, if the receiver is closed
Warning:
This sender gets messages quite often, once every ~10kB progress. If it’s too slow, some on_progress events will be dropped.
pub fn connect_on_progress_sender_slow(
self,
sender: Sender<CallbackArguments>,
cancel_on_close: bool
) -> Self
[src]
self,
sender: Sender<CallbackArguments>,
cancel_on_close: bool
) -> Self
stream
only.Attach a bounded sender that receives messages on progress cancel_or_close indicates whether or not to cancel the download, if the receiver is closed
This closure will be executed more seldom, around once for every MB downloaded.
pub fn connect_on_complete_closure(
self,
closure: impl Fn(Option<PathBuf>) + 'static
) -> Self
[src]
self,
closure: impl Fn(Option<PathBuf>) + 'static
) -> Self
stream
only.Attach a closure to be executed on complete
pub fn connect_on_complete_closure_async<Fut: Future<Output = ()> + Send + 'static, F: Fn(Option<PathBuf>) -> Fut + 'static>(
self,
closure: F
) -> Self
[src]
self,
closure: F
) -> Self
stream
only.Attach a async closure to be executed on complete
Trait Implementations
impl Debug for Callback
[src]
stream
only.impl Default for Callback
[src]
stream
only.Auto Trait Implementations
impl !RefUnwindSafe for Callback
impl !Send for Callback
impl !Sync for Callback
impl Unpin for Callback
impl !UnwindSafe for Callback
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,