diff --git a/kube-runtime/Cargo.toml b/kube-runtime/Cargo.toml index 30b184746..5e95ad316 100644 --- a/kube-runtime/Cargo.toml +++ b/kube-runtime/Cargo.toml @@ -14,6 +14,10 @@ categories = ["web-programming::http-client", "caching", "network-programming"] rust-version = "1.60.0" edition = "2021" +[features] +unstable_runtime = ["unstable_runtime_subscribe"] +unstable_runtime_subscribe = [] + [package.metadata.docs.rs] features = ["k8s-openapi/v1_26"] # Define the configuration attribute `docsrs`. Used to enable `doc_cfg` feature. diff --git a/kube-runtime/src/utils/mod.rs b/kube-runtime/src/utils/mod.rs index 766c291fa..427b0a120 100644 --- a/kube-runtime/src/utils/mod.rs +++ b/kube-runtime/src/utils/mod.rs @@ -9,6 +9,7 @@ mod watch_ext; pub use backoff_reset_timer::ResetTimerBackoff; pub use event_flatten::EventFlatten; pub use stream_backoff::StreamBackoff; +#[cfg(feature = "unstable_runtime_subscribe")] pub use stream_subscribe::StreamSubscribe; pub use watch_ext::WatchStreamExt; diff --git a/kube-runtime/src/utils/watch_ext.rs b/kube-runtime/src/utils/watch_ext.rs index 02b37423d..f825fa2a1 100644 --- a/kube-runtime/src/utils/watch_ext.rs +++ b/kube-runtime/src/utils/watch_ext.rs @@ -93,6 +93,7 @@ pub trait WatchStreamExt: Stream { /// (stream_subscribe, explain_stream) /// } /// ``` + #[cfg(feature = "unstable_runtime_subscribe")] fn stream_subscribe(self) -> StreamSubscribe where Self: Stream, watcher::Error>> + Send + Sized + 'static,