From e4cb9f7f35ce2954f2d755084b2dcf80adf73fdf Mon Sep 17 00:00:00 2001 From: Mathias Kraus Date: Sun, 14 Jul 2024 11:45:59 +0200 Subject: [PATCH] [#210] Use bullet points for safety section in docs --- iceoryx2-ffi/ffi/src/node.rs | 16 ++++++++-------- iceoryx2-ffi/ffi/src/node_builder.rs | 12 ++++++------ iceoryx2-ffi/ffi/src/node_name.rs | 14 +++++++------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/iceoryx2-ffi/ffi/src/node.rs b/iceoryx2-ffi/ffi/src/node.rs index d9c8852a..9fbdacfb 100644 --- a/iceoryx2-ffi/ffi/src/node.rs +++ b/iceoryx2-ffi/ffi/src/node.rs @@ -187,7 +187,7 @@ pub type iox2_node_list_callback = extern "C" fn( /// /// # Safety /// -/// The `node_handle` must be valid and obtained by [`iox2_node_builder_create`](crate::iox2_node_builder_create)! +/// * The `node_handle` must be valid and obtained by [`iox2_node_builder_create`](crate::iox2_node_builder_create)! #[no_mangle] pub unsafe extern "C" fn iox2_node_name(node_handle: iox2_node_h) -> iox2_node_name_ptr { debug_assert!(!node_handle.is_null()); @@ -206,7 +206,7 @@ pub unsafe extern "C" fn iox2_node_name(node_handle: iox2_node_h) -> iox2_node_n /// /// # Safety /// -/// The `node_handle` must be valid and obtained by [`iox2_node_builder_create`](crate::iox2_node_builder_create)! +/// * The `node_handle` must be valid and obtained by [`iox2_node_builder_create`](crate::iox2_node_builder_create)! #[no_mangle] pub unsafe extern "C" fn iox2_node_config(node_handle: iox2_node_h) -> iox2_config_ptr { debug_assert!(!node_handle.is_null()); @@ -225,7 +225,7 @@ pub unsafe extern "C" fn iox2_node_config(node_handle: iox2_node_h) -> iox2_conf /// /// # Safety /// -/// The `node_handle` must be valid and obtained by [`iox2_node_builder_create`](crate::iox2_node_builder_create)! +/// * The `node_handle` must be valid and obtained by [`iox2_node_builder_create`](crate::iox2_node_builder_create)! #[no_mangle] pub unsafe extern "C" fn iox2_node_id(node_handle: iox2_node_h) -> iox2_node_id_ptr { debug_assert!(!node_handle.is_null()); @@ -311,7 +311,7 @@ fn iox2_node_list_impl( /// /// # Safety /// -/// The `config_ptr` must be valid and obtained by ether [`iox2_node_config`] or [`iox2_config_global_config`](crate::iox2_config_global_config)! +/// * The `config_ptr` must be valid and obtained by ether [`iox2_node_config`] or [`iox2_config_global_config`](crate::iox2_config_global_config)! #[no_mangle] pub unsafe extern "C" fn iox2_node_list( service_type: iox2_service_type_e, @@ -344,8 +344,8 @@ pub extern "C" fn iox2_service_name_new() {} /// /// # Safety /// -/// The `node_handle` must be valid and obtained by [`iox2_node_builder_create`](crate::iox2_node_builder_create)! -/// The `service_name_handle` must be valid and obtained by [`iox2_service_name_new`]! +/// * The `node_handle` must be valid and obtained by [`iox2_node_builder_create`](crate::iox2_node_builder_create)! +/// * The `service_name_handle` must be valid and obtained by [`iox2_service_name_new`]! #[no_mangle] pub unsafe extern "C" fn iox2_node_service_builder( node_handle: iox2_node_h, @@ -365,8 +365,8 @@ pub unsafe extern "C" fn iox2_node_service_builder( /// /// # Safety /// -/// The `node_handle` is invalid after the return of this function and leads to undefined behavior if used in another function call! -/// The corresponding [`iox2_node_t`] can be re-used with a call to [`iox2_node_builder_create`](crate::iox2_node_builder_create)! +/// * The `node_handle` is invalid after the return of this function and leads to undefined behavior if used in another function call! +/// * The corresponding [`iox2_node_t`] can be re-used with a call to [`iox2_node_builder_create`](crate::iox2_node_builder_create)! #[no_mangle] pub unsafe extern "C" fn iox2_node_drop(node_handle: iox2_node_h) { debug_assert!(!node_handle.is_null()); diff --git a/iceoryx2-ffi/ffi/src/node_builder.rs b/iceoryx2-ffi/ffi/src/node_builder.rs index c9999693..8313e7c1 100644 --- a/iceoryx2-ffi/ffi/src/node_builder.rs +++ b/iceoryx2-ffi/ffi/src/node_builder.rs @@ -144,7 +144,7 @@ pub type iox2_node_builder_ref_h = *mut iox2_node_builder_ref_h_t; /// /// # Safety /// -/// The same [`iox2_node_builder_t`] cannot be used in subsequent calls to this function, unless [`iox2_node_builder_create`] was called before! +/// * The same [`iox2_node_builder_t`] cannot be used in subsequent calls to this function, unless [`iox2_node_builder_create`] was called before! #[no_mangle] pub unsafe extern "C" fn iox2_node_builder_new( node_builder_struct_ptr: *mut iox2_node_builder_t, @@ -176,8 +176,8 @@ pub unsafe extern "C" fn iox2_node_builder_new( /// /// # Safety /// -/// The `node_builder_handle` must be a valid handle. -/// The `node_builder_handle` is still valid after the call to this function. +/// * The `node_builder_handle` must be a valid handle. +/// * The `node_builder_handle` is still valid after the call to this function. #[no_mangle] pub unsafe extern "C" fn iox2_cast_node_builder_ref_h( node_builder_handle: iox2_node_builder_h, @@ -198,7 +198,7 @@ pub unsafe extern "C" fn iox2_cast_node_builder_ref_h( /// /// # Safety /// -/// `node_builder_handle` as well as `node_name_handle` must be valid handles +/// * `node_builder_handle` as well as `node_name_handle` must be valid handles #[no_mangle] pub unsafe extern "C" fn iox2_node_builder_set_name( node_builder_handle: iox2_node_builder_ref_h, @@ -252,8 +252,8 @@ unsafe fn iox2_node_builder_drop(node_builder_handle: iox2_node_builder_h) { /// /// # Safety /// -/// The `node_builder_handle` is invalid after the return of this function and leads to undefined behavior if used in another function call! -/// The corresponding [`iox2_node_builder_t`] can be re-used with a call to [`iox2_node_builder_new`]! +/// * The `node_builder_handle` is invalid after the return of this function and leads to undefined behavior if used in another function call! +/// * The corresponding [`iox2_node_builder_t`] can be re-used with a call to [`iox2_node_builder_new`]! #[no_mangle] pub unsafe extern "C" fn iox2_node_builder_create( node_builder_handle: iox2_node_builder_h, diff --git a/iceoryx2-ffi/ffi/src/node_name.rs b/iceoryx2-ffi/ffi/src/node_name.rs index fb311a79..420daf53 100644 --- a/iceoryx2-ffi/ffi/src/node_name.rs +++ b/iceoryx2-ffi/ffi/src/node_name.rs @@ -126,8 +126,8 @@ pub type iox2_node_name_mut_ptr = *mut iox2_node_name_mut_ptr_t; /// /// # Safety /// -/// Terminates if `node_name_str` or `node_name_handle_ptr` is a NULL pointer! -/// It is undefined behavior to pass a `node_name_len` which is larger than the actual length of `node_name_str`! +/// * Terminates if `node_name_str` or `node_name_handle_ptr` is a NULL pointer! +/// * It is undefined behavior to pass a `node_name_len` which is larger than the actual length of `node_name_str`! #[no_mangle] pub unsafe extern "C" fn iox2_node_name_new( node_name_struct_ptr: *mut iox2_node_name_t, @@ -189,8 +189,8 @@ pub unsafe extern "C" fn iox2_node_name_new( /// /// # Safety /// -/// The `node_name_handle` must be a valid handle. -/// The `node_name_handle` is still valid after the call to this function. +/// * The `node_name_handle` must be a valid handle. +/// * The `node_name_handle` is still valid after the call to this function. #[no_mangle] pub unsafe extern "C" fn iox2_cast_node_name_ptr( node_name_handle: iox2_node_name_h, @@ -213,7 +213,7 @@ pub unsafe extern "C" fn iox2_cast_node_name_ptr( /// /// # Safety /// -/// The `node_name_ptr` must be a valid pointer to a node name. +/// * The `node_name_ptr` must be a valid pointer to a node name. #[no_mangle] pub unsafe extern "C" fn iox2_node_name_as_c_str( node_name_ptr: iox2_node_name_ptr, @@ -242,8 +242,8 @@ pub unsafe extern "C" fn iox2_node_name_as_c_str( /// /// # Safety /// -/// The `node_name_handle` is invalid after the return of this function and leads to undefined behavior if used in another function call! -/// The corresponding [`iox2_node_name_t`] can be re-used with a call to [`iox2_node_name_new`]! +/// * The `node_name_handle` is invalid after the return of this function and leads to undefined behavior if used in another function call! +/// * The corresponding [`iox2_node_name_t`] can be re-used with a call to [`iox2_node_name_new`]! #[no_mangle] pub unsafe extern "C" fn iox2_node_name_drop(node_name_handle: iox2_node_name_h) { debug_assert!(!node_name_handle.is_null());