Use sipper::Core in Task::sip
This commit is contained in:
parent
7ba2e39133
commit
6154395be0
1 changed files with 4 additions and 4 deletions
|
|
@ -61,13 +61,13 @@ impl<T> Task<T> {
|
||||||
|
|
||||||
/// Creates a [`Task`] that runs the given [`Sipper`] to completion, mapping
|
/// Creates a [`Task`] that runs the given [`Sipper`] to completion, mapping
|
||||||
/// progress with the first closure and the output with the second one.
|
/// progress with the first closure and the output with the second one.
|
||||||
pub fn sip<S, Output, Progress>(
|
pub fn sip<S>(
|
||||||
sipper: S,
|
sipper: S,
|
||||||
on_progress: impl Fn(Progress) -> T + MaybeSend + 'static,
|
on_progress: impl Fn(S::Progress) -> T + MaybeSend + 'static,
|
||||||
on_output: impl FnOnce(Output) -> T + MaybeSend + 'static,
|
on_output: impl FnOnce(<S as Future>::Output) -> T + MaybeSend + 'static,
|
||||||
) -> Self
|
) -> Self
|
||||||
where
|
where
|
||||||
S: Sipper<Output, Progress> + MaybeSend + 'static,
|
S: sipper::Core + MaybeSend + 'static,
|
||||||
T: MaybeSend + 'static,
|
T: MaybeSend + 'static,
|
||||||
{
|
{
|
||||||
Self::stream(stream(sipper::sipper(move |sender| async move {
|
Self::stream(stream(sipper::sipper(move |sender| async move {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue