Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update type doc with the links to concepts #683

Merged
merged 1 commit into from
Sep 19, 2024
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
6 changes: 3 additions & 3 deletions docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Data Structures
Owned Types
~~~~~~~~~~~

TODO: owned type description
See :ref:`owned_types_concept`

.. c:type:: z_owned_slice_t

Expand Down Expand Up @@ -130,7 +130,7 @@ TODO: owned type description
Loaned Types
~~~~~~~~~~~

TODO: loaned type description
See :ref:`loaned_types_concept`

.. c:type:: z_loaned_slice_t

Expand Down Expand Up @@ -199,7 +199,7 @@ TODO: loaned type description
View Types
~~~~~~~~~~~

TODO: view type description
See :ref:`view_types_concept`

.. c:type:: z_view_string_t

Expand Down
8 changes: 8 additions & 0 deletions docs/concepts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Zenoh-Pico types fall into these categories:
- Option structures: `z_xxx_options_t`
- Enums and plain data structures: `z_xxx_t`

.. _owned_types_concept:

Owned Types `z_owned_xxx_t`
---------------------------

Expand All @@ -47,6 +49,8 @@ the `z_drop` macro. Example:
Owned objects can be passed to functions in two ways: by moving (`z_moved_xxx_t`) or
loaning (`z_loaned_xxx_t`).

.. _loaned_types_concept:

Loaned Types `z_loaned_xxx_t`
-----------------------------

Expand All @@ -68,6 +72,8 @@ modify (`z_loaned_xxx_t*`) the object. In both cases, ownership remains with the
z_drop(z_move(s));
z_drop(z_move(s1));

.. _moved_types_concept:

Moved types `z_moved_xxx_t`
---------------------------

Expand All @@ -89,6 +95,8 @@ it's not required. Note that `z_drop` itself takes ownership, so `z_move` is als
}
// z_drop(z_move(cfg)); // this is safe but useless

.. _view_types_concept:

View Types `z_view_xxx_t`
-------------------------

Expand Down
Loading