diff --git a/zenoh/__init__.pyi b/zenoh/__init__.pyi index 007fa6d..6c3bad4 100644 --- a/zenoh/__init__.pyi +++ b/zenoh/__init__.pyi @@ -32,6 +32,14 @@ _RustHandler = ( _PythonCallback = Callable[[_T], Any] _PythonHandler = tuple[_PythonCallback[_T], _H] +def unstable(original): + _WARNING = "Warning: This API has been marked as unstable: it works as advertised, but it may be changed in a future release." + if original.__doc__: + original.__doc__ += "\n" + _WARNING + else: + original.__doc__ = _WARNING + return original + @final class ZError(Exception): ... @@ -349,6 +357,7 @@ class KeyExpr: _IntoKeyExpr = KeyExpr | str @final +@unstable class Liveliness: def declare_token(self, key_expr: _IntoKeyExpr) -> LivelinessToken: """Create a LivelinessToken for the given key expression.""" @@ -414,6 +423,7 @@ class Liveliness: """Create a Subscriber for liveliness changes matching the given key expression.""" @final +@unstable class LivelinessToken: def __enter__(self) -> Self: ... def __exit__(self, *_args, **_kwargs): ... @@ -484,6 +494,7 @@ class Publisher: @property def priority(self) -> Priority: ... @property + @unstable def reliability(self) -> Reliability: ... def put( self, @@ -574,8 +585,9 @@ class Queryable(Generic[_H]): def __iter__(self) -> Never: ... @final +@unstable class Querier: - """A querier that allows to send queries to a queryable.. + """A querier that allows to send queries to a queryable. Queriers are automatically undeclared when dropped.""" def __enter__(self) -> Self: ... @@ -642,6 +654,7 @@ class QueryTarget(Enum): DEFAULT = BEST_MATCHING @final +@unstable class Reliability(Enum): BEST_EFFORT = auto() RELIABLE = auto() @@ -944,6 +957,7 @@ class Session: ) -> Publisher: """Create a Publisher for the given key expression.""" + @unstable def declare_querier( self, key_expr: _IntoKeyExpr,