Make sipper dependency optional
This commit is contained in:
parent
cf827dd349
commit
9f1beba583
8 changed files with 18 additions and 8 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
|
@ -2405,6 +2405,7 @@ dependencies = [
|
|||
"iced_futures",
|
||||
"iced_highlighter",
|
||||
"iced_renderer",
|
||||
"iced_runtime",
|
||||
"iced_wgpu",
|
||||
"iced_widget",
|
||||
"iced_winit",
|
||||
|
|
|
|||
|
|
@ -67,11 +67,14 @@ auto-detect-theme = ["iced_core/auto-detect-theme"]
|
|||
strict-assertions = ["iced_renderer/strict-assertions"]
|
||||
# Redraws on every runtime event, and not only when a widget requests it
|
||||
unconditional-rendering = ["iced_winit/unconditional-rendering"]
|
||||
# Enables support for the `sipper` library
|
||||
sipper = ["iced_runtime/sipper"]
|
||||
|
||||
[dependencies]
|
||||
iced_core.workspace = true
|
||||
iced_futures.workspace = true
|
||||
iced_renderer.workspace = true
|
||||
iced_runtime.workspace = true
|
||||
iced_widget.workspace = true
|
||||
iced_winit.features = ["program"]
|
||||
iced_winit.workspace = true
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ publish = false
|
|||
|
||||
[dependencies]
|
||||
iced.workspace = true
|
||||
iced.features = ["tokio"]
|
||||
iced.features = ["tokio", "sipper"]
|
||||
|
||||
[dependencies.reqwest]
|
||||
version = "0.12"
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ publish = false
|
|||
|
||||
[dependencies]
|
||||
iced.workspace = true
|
||||
iced.features = ["tokio", "image", "web-colors", "debug"]
|
||||
iced.features = ["tokio", "sipper", "image", "web-colors", "debug"]
|
||||
|
||||
reqwest.version = "0.12"
|
||||
reqwest.features = ["json"]
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ publish = false
|
|||
|
||||
[dependencies]
|
||||
iced.workspace = true
|
||||
iced.features = ["debug", "tokio"]
|
||||
iced.features = ["debug", "tokio", "sipper"]
|
||||
|
||||
warp = "0.3"
|
||||
|
||||
|
|
|
|||
|
|
@ -23,5 +23,7 @@ iced_core.workspace = true
|
|||
iced_futures.workspace = true
|
||||
|
||||
raw-window-handle.workspace = true
|
||||
sipper.workspace = true
|
||||
thiserror.workspace = true
|
||||
|
||||
sipper.workspace = true
|
||||
sipper.optional = true
|
||||
|
|
|
|||
|
|
@ -7,8 +7,10 @@ use crate::futures::futures::future::{self, FutureExt};
|
|||
use crate::futures::futures::stream::{self, Stream, StreamExt};
|
||||
use crate::futures::{BoxStream, MaybeSend, boxed_stream};
|
||||
|
||||
use std::convert::Infallible;
|
||||
use std::sync::Arc;
|
||||
|
||||
#[cfg(feature = "sipper")]
|
||||
#[doc(no_inline)]
|
||||
pub use sipper::{Never, Sender, Sipper, Straw, sipper, stream};
|
||||
|
||||
|
|
@ -60,6 +62,7 @@ impl<T> Task<T> {
|
|||
|
||||
/// Creates a [`Task`] that runs the given [`Sipper`] to completion, mapping
|
||||
/// progress with the first closure and the output with the second one.
|
||||
#[cfg(feature = "sipper")]
|
||||
pub fn sip<S>(
|
||||
sipper: S,
|
||||
on_progress: impl FnMut(S::Progress) -> T + MaybeSend + 'static,
|
||||
|
|
@ -391,7 +394,7 @@ where
|
|||
}
|
||||
|
||||
/// Creates a new [`Task`] that executes the given [`Action`] and produces no output.
|
||||
pub fn effect<T>(action: impl Into<Action<Never>>) -> Task<T> {
|
||||
pub fn effect<T>(action: impl Into<Action<Infallible>>) -> Task<T> {
|
||||
let action = action.into();
|
||||
|
||||
Task(Some(boxed_stream(stream::once(async move {
|
||||
|
|
|
|||
|
|
@ -531,9 +531,10 @@ pub use alignment::Vertical::{Bottom, Top};
|
|||
|
||||
pub mod task {
|
||||
//! Create runtime tasks.
|
||||
pub use crate::runtime::task::{
|
||||
Handle, Never, Sipper, Straw, Task, sipper, stream,
|
||||
};
|
||||
pub use crate::runtime::task::{Handle, Task};
|
||||
|
||||
#[cfg(feature = "sipper")]
|
||||
pub use crate::runtime::task::{Never, Sipper, Straw, sipper, stream};
|
||||
}
|
||||
|
||||
pub mod clipboard {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue