diff --git a/src/value.rs b/src/value.rs index ceb8d727..ab5aa160 100644 --- a/src/value.rs +++ b/src/value.rs @@ -297,6 +297,10 @@ impl _Reply { Ok(_) => Err(zenoh_core::zerror!("Called `Reply.err` on a non-err reply.").to_pyerr()), } } + #[getter] + pub fn is_ok(&self) -> bool { + self.reply.is_ok() + } } impl From for _Reply { fn from(reply: Reply) -> Self { diff --git a/zenoh/value.py b/zenoh/value.py index 6446f52a..e0708f0b 100644 --- a/zenoh/value.py +++ b/zenoh/value.py @@ -181,6 +181,16 @@ def __new__(cls, inner: _Reply): def replier_id(self) -> ZenohId: "The reply's sender's id." return ZenohId._upgrade_(super().replier_id) + + @property + def is_ok(self) -> bool: + """ + Checks if the reply is `ok`. + + Returns `True` if the reply is `ok`, `False` otherwise + """ + return super.is_ok() + @property def ok(self) -> Sample: """