Struct ucp_generic_dt_ops

Source
#[repr(C)]
pub struct ucp_generic_dt_ops { pub start_pack: Option<unsafe extern "C" fn(context: *mut c_void, buffer: *const c_void, count: size_t) -> *mut c_void>, pub start_unpack: Option<unsafe extern "C" fn(context: *mut c_void, buffer: *mut c_void, count: size_t) -> *mut c_void>, pub packed_size: Option<unsafe extern "C" fn(state: *mut c_void) -> size_t>, pub pack: Option<unsafe extern "C" fn(state: *mut c_void, offset: size_t, dest: *mut c_void, max_length: size_t) -> size_t>, pub unpack: Option<unsafe extern "C" fn(state: *mut c_void, offset: size_t, src: *const c_void, length: size_t) -> ucs_status_t>, pub finish: Option<unsafe extern "C" fn(state: *mut c_void)>, }
Expand description

@ingroup UCP_DATATYPE @brief UCP generic data type descriptor

This structure provides a generic datatype descriptor that is used for definition of application defined datatypes.

Typically, the descriptor is used for an integration with datatype engines implemented within MPI and SHMEM implementations.

@note In case of partial receive, any amount of received data is acceptable which matches buffer size.

Fields§

§start_pack: Option<unsafe extern "C" fn(context: *mut c_void, buffer: *const c_void, count: size_t) -> *mut c_void>

@ingroup UCP_DATATYPE @brief Start a packing request.

The pointer refers to application defined start-to-pack routine. It will be called from the @ref ucp_tag_send_nb routine.

@param [in] context User-defined context. @param [in] buffer Buffer to pack. @param [in] count Number of elements to pack into the buffer.

@return A custom state that is passed to the following @ref ucp_generic_dt_ops::pack “pack()” routine.

§start_unpack: Option<unsafe extern "C" fn(context: *mut c_void, buffer: *mut c_void, count: size_t) -> *mut c_void>

@ingroup UCP_DATATYPE @brief Start an unpacking request.

The pointer refers to application defined start-to-unpack routine. It will be called from the @ref ucp_tag_recv_nb routine.

@param [in] context User-defined context. @param [in] buffer Buffer to unpack to. @param [in] count Number of elements to unpack in the buffer.

@return A custom state that is passed later to the following @ref ucp_generic_dt_ops::unpack “unpack()” routine.

§packed_size: Option<unsafe extern "C" fn(state: *mut c_void) -> size_t>

@ingroup UCP_DATATYPE @brief Get the total size of packed data.

The pointer refers to user defined routine that returns the size of data in a packed format.

@param [in] state State as returned by @ref ucp_generic_dt_ops::start_pack “start_pack()” routine.

@return The size of the data in a packed form.

§pack: Option<unsafe extern "C" fn(state: *mut c_void, offset: size_t, dest: *mut c_void, max_length: size_t) -> size_t>

@ingroup UCP_DATATYPE @brief Pack data.

The pointer refers to application defined pack routine.

@param [in] state State as returned by @ref ucp_generic_dt_ops::start_pack “start_pack()” routine. @param [in] offset Virtual offset in the output stream. @param [in] dest Destination buffer to pack the data. @param [in] max_length Maximum length to pack.

@return The size of the data that was written to the destination buffer. Must be less than or equal to @e max_length.

§unpack: Option<unsafe extern "C" fn(state: *mut c_void, offset: size_t, src: *const c_void, length: size_t) -> ucs_status_t>

@ingroup UCP_DATATYPE @brief Unpack data.

The pointer refers to application defined unpack routine.

@param [in] state State as returned by @ref ucp_generic_dt_ops::start_unpack “start_unpack()” routine. @param [in] offset Virtual offset in the input stream. @param [in] src Source to unpack the data from. @param [in] length Length to unpack.

@return UCS_OK or an error if unpacking failed.

§finish: Option<unsafe extern "C" fn(state: *mut c_void)>

@ingroup UCP_DATATYPE @brief Finish packing/unpacking.

The pointer refers to application defined finish routine.

@param [in] state State as returned by @ref ucp_generic_dt_ops::start_pack “start_pack()” and @ref ucp_generic_dt_ops::start_unpack “start_unpack()” routines.

Trait Implementations§

Source§

impl Clone for ucp_generic_dt_ops

Source§

fn clone(&self) -> ucp_generic_dt_ops

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 Debug for ucp_generic_dt_ops

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for ucp_generic_dt_ops

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.