Use sipper::Core in Task::sip

This commit is contained in:
Héctor Ramón Jiménez 2025-02-10 17:47:18 +01:00
parent 7ba2e39133
commit 6154395be0
No known key found for this signature in database
GPG key ID: 7CC46565708259A7

View file

@ -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 {