diff --git a/docs/conf.py b/docs/conf.py index 6b441a4f..1f6d3957 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -26,6 +26,7 @@ import tomllib import zenoh +import zenoh.ext # -- Project information ----------------------------------------------------- diff --git a/docs/index.rst b/docs/index.rst index 2933bf0e..48e511c9 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -74,3 +74,10 @@ module zenoh.handlers .. automodule:: zenoh.handlers :members: :undoc-members: + +module zenoh.ext +================ + +.. automodule:: zenoh.ext + :members: + :undoc-members: diff --git a/zenoh/ext.pyi b/zenoh/ext.pyi index a497f783..d291ebe0 100644 --- a/zenoh/ext.pyi +++ b/zenoh/ext.pyi @@ -43,5 +43,28 @@ class Float64(float): class ZDeserializeError(Exception): pass -def z_serialize(obj: Any) -> ZBytes: ... -def z_deserialize(tp: type[_T], zbytes: ZBytes) -> _T: ... +def z_serialize(obj: Any) -> ZBytes: + """Serialize an object of supported type according to the `Zenoh serialization format `_. + + Supported types are: + + * UInt8, UInt16, Uint32, UInt64, UInt128, Int8, Int16, Int32, Int64, Int128, int (handled as int32), Float32, Float64, float (handled as Float64), bool; + + * Str, Bytes, ByteArray; + + * List, Dict, Set, FrozenSet and Tuple of supported types. + """ + pass + +def z_deserialize(tp: type[_T], zbytes: ZBytes) -> _T: + """Deserialize into an object of supported type according to the `Zenoh serialization format `_. + + Supported types are: + + * UInt8, UInt16, Uint32, UInt64, UInt128, Int8, Int16, Int32, Int64, Int128, int (handled as int32), Float32, Float64, float (handled as Float64), bool; + + * Str, Bytes, ByteArray; + + * List, Dict, Set, FrozenSet and Tuple of supported types. + """ + pass