Skip to content

Commit

Permalink
[eclipse-iceoryx#490] Add documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
orecham committed Oct 31, 2024
1 parent a450cc8 commit 7ce0aca
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
11 changes: 11 additions & 0 deletions iceoryx2-ffi/ffi/src/api/port_factory_publisher_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,17 @@ impl HandleToType for iox2_port_factory_publisher_builder_h_ref {

// BEGIN C API

/// Sets the max slice length for the publisher
///
/// # Arguments
///
/// * `port_factory_handle` - Must be a valid [`iox2_port_factory_publisher_builder_h_ref`]
/// obtained by [`iox2_port_factory_pub_sub_publisher_builder`](crate::iox2_port_factory_pub_sub_publisher_builder).
/// * `value` - The value to set max slice length to
///
/// # Safety
///
/// * `port_factory_handle` must be valid handles
#[no_mangle]
pub unsafe extern "C" fn iox2_port_factory_publisher_builder_set_max_slice_len(
port_factory_handle: iox2_port_factory_publisher_builder_h_ref,
Expand Down
12 changes: 12 additions & 0 deletions iceoryx2-ffi/ffi/src/api/publisher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,18 @@ pub unsafe extern "C" fn iox2_publisher_unable_to_deliver_strategy(
}
}

/// Returns the maximum `[u8]` length that can be loaned in one sample, i.e. the max number of
/// elements in the `[u8]` payload type used by the C binding.
///
/// # Arguments
///
/// * `publisher_handle` obtained by [`iox2_port_factory_publisher_builder_create`](crate::iox2_port_factory_publisher_builder_create)
///
/// Returns the maximum number of elements as a [`c_int`].
///
/// # Safety
///
/// * `publisher_handle` is valid and non-null
#[no_mangle]
pub unsafe extern "C" fn iox2_publisher_max_slice_len(
publisher_handle: iox2_publisher_h_ref,
Expand Down
11 changes: 11 additions & 0 deletions iceoryx2-ffi/ffi/src/api/service_builder_pub_sub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,17 @@ pub unsafe extern "C" fn iox2_service_builder_pub_sub_set_max_subscribers(
}
}

/// Sets the payload alignment for the builder
///
/// # Arguments
///
/// * `service_builder_handle` - Must be a valid [`iox2_service_builder_pub_sub_h_ref`]
/// obtained by [`iox2_service_builder_pub_sub`](crate::iox2_service_builder_pub_sub).
/// * `value` - The value to set the payload alignment to
///
/// # Safety
///
/// * `service_builder_handle` must be valid handles
#[no_mangle]
pub unsafe extern "C" fn iox2_service_builder_pub_sub_set_payload_alignment(
service_builder_handle: iox2_service_builder_pub_sub_h_ref,
Expand Down

0 comments on commit 7ce0aca

Please sign in to comment.