pub struct Callback {
    pub on_progress: OnProgressType,
    pub on_complete: OnCompleteType,
    /* private fields */
}
Expand description

Methods and streams to process either on_progress or on_complete

Fields

on_progress: OnProgressTypeon_complete: OnCompleteType

Implementations

Create a new callback struct without actual callbacks

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

Attach a closure to be executed on progress. This closure will be executed more seldom, around once for every MB downloaded.

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

Attach a async closure to be executed on progress. This closure will be executed more seldom, around once for every MB downloaded.

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.

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.

Attach a closure to be executed on complete

Attach a async closure to be executed on complete

Trait Implementations

Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

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

Calls U::from(self).

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

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more