summaryrefslogtreecommitdiff
path: root/cli/ops/mod.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/ops/mod.rs')
-rw-r--r--cli/ops/mod.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/cli/ops/mod.rs b/cli/ops/mod.rs
index cbaa932aa..c6d5cc1dc 100644
--- a/cli/ops/mod.rs
+++ b/cli/ops/mod.rs
@@ -58,6 +58,17 @@ where
rt.register_op(name, metrics_op(json_op_sync(op_fn)));
}
+/// Helper for checking unstable features. Used for sync ops.
+pub fn check_unstable(state: &OpState, api_name: &str) {
+ state.borrow::<Arc<GlobalState>>().check_unstable(api_name)
+}
+
+/// Helper for checking unstable features. Used for async ops.
+pub fn check_unstable2(state: &Rc<RefCell<OpState>>, api_name: &str) {
+ let state = state.borrow();
+ state.borrow::<Arc<GlobalState>>().check_unstable(api_name)
+}
+
/// Helper for extracting the commonly used state. Used for sync ops.
pub fn global_state(state: &OpState) -> Arc<GlobalState> {
state.borrow::<Arc<GlobalState>>().clone()