Skip to content

Commit

Permalink
[eclipse-iceoryx#210] Use bullet points for safety section in docs
Browse files Browse the repository at this point in the history
  • Loading branch information
elBoberido committed Jul 14, 2024
1 parent a54def6 commit e4cb9f7
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 21 deletions.
16 changes: 8 additions & 8 deletions iceoryx2-ffi/ffi/src/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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());
Expand All @@ -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());
Expand Down Expand Up @@ -311,7 +311,7 @@ fn iox2_node_list_impl<S: Service>(
///
/// # 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,
Expand Down Expand Up @@ -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,
Expand All @@ -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());
Expand Down
12 changes: 6 additions & 6 deletions iceoryx2-ffi/ffi/src/node_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
14 changes: 7 additions & 7 deletions iceoryx2-ffi/ffi/src/node_name.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand All @@ -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,
Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit e4cb9f7

Please sign in to comment.