Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import tomllib

import zenoh
import zenoh.ext

# -- Project information -----------------------------------------------------

Expand Down
7 changes: 7 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,10 @@ module zenoh.handlers
.. automodule:: zenoh.handlers
:members:
:undoc-members:

module zenoh.ext
================

.. automodule:: zenoh.ext
:members:
:undoc-members:
27 changes: 25 additions & 2 deletions zenoh/ext.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/eclipse-zenoh/roadmap/blob/main/rfcs/ALL/Serialization.md>`_.

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 <https://github.com/eclipse-zenoh/roadmap/blob/main/rfcs/ALL/Serialization.md>`_.

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
Loading