Struct ucp_request_param_t

Source
#[repr(C)]
pub struct ucp_request_param_t { pub op_attr_mask: u32, pub flags: u32, pub request: *mut c_void, pub cb: ucp_request_param_t__bindgen_ty_1, pub datatype: ucp_datatype_t, pub user_data: *mut c_void, pub reply_buffer: *mut c_void, pub memory_type: ucs_memory_type_t, pub recv_info: ucp_request_param_t__bindgen_ty_2, }
Expand description

@ingroup UCP_CONTEXT @brief Operation parameters passed to @ref ucp_tag_send_nbx, @ref ucp_tag_send_sync_nbx, @ref ucp_tag_recv_nbx, @ref ucp_put_nbx, @ref ucp_get_nbx, @ref ucp_am_send_nbx and @ref ucp_am_recv_data_nbx.

The structure @ref ucp_request_param_t is used to specify datatype of operation, provide user request in case the external request is used, set completion callback and custom user data passed to this callback.

Example: implementation of function to send contiguous buffer to ep and invoke callback function at operation completion. If the operation completed immediately (status == UCS_OK) then callback is not called.

@code{.c} ucs_status_ptr_t send_data(ucp_ep_h ep, void *buffer, size_t length, ucp_tag_t tag, void *request) { ucp_request_param_t param = { .op_attr_mask = UCP_OP_ATTR_FIELD_CALLBACK | UCP_OP_ATTR_FIELD_REQUEST, .request = request, .cb.send = custom_send_callback_f, .user_data = pointer_to_user_context_passed_to_cb };

ucs_status_ptr_t status;

status = ucp_tag_send_nbx(ep, buffer, length, tag, &param);
if (UCS_PTR_IS_ERR(status)) {
    handle_error(status);
} else if (status == UCS_OK) {
    // operation is completed
}

return status;

} @endcode

Fields§

§op_attr_mask: u32

Mask of valid fields in this structure and operation flags, using bits from @ref ucp_op_attr_t. Fields not specified in this mask will be ignored. Provides ABI compatibility with respect to adding new fields.

§flags: u32§request: *mut c_void

Request handle allocated by the user. There should be at least UCP request size bytes of available space before the @a request. The size of the UCP request can be obtained by @ref ucp_context_query function.

§cb: ucp_request_param_t__bindgen_ty_1§datatype: ucp_datatype_t

Datatype descriptor for the elements in the buffer. In case the op_attr_mask & UCP_OP_ATTR_FIELD_DATATYPE bit is not set, then use default datatype ucp_dt_make_contig(1)

§user_data: *mut c_void

Pointer to user data passed to callback function.

§reply_buffer: *mut c_void

Reply buffer. Can be used for storing operation result, for example by @ref ucp_atomic_op_nbx.

§memory_type: ucs_memory_type_t

Memory type of the buffer. see @ref ucs_memory_type_t for possible memory types. An optimization hint to avoid memory type detection for request buffer. If this value is not set (along with its corresponding bit in the op_attr_mask - @ref UCP_OP_ATTR_FIELD_MEMORY_TYPE), then use default @ref UCS_MEMORY_TYPE_UNKNOWN which means the memory type will be detected internally.

§recv_info: ucp_request_param_t__bindgen_ty_2

Trait Implementations§

Source§

impl Clone for ucp_request_param_t

Source§

fn clone(&self) -> ucp_request_param_t

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for ucp_request_param_t

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.