Available on crate feature
dlopen2 only.Expand description
Dynamic loading of the MQI library using dlopen2
§Example
Dynamically load the libmqm_r library and issue an MQCONN
use dlopen2::wrapper::Container;
use libmqm_sys::{self as mq, dlopen2::MqWrapper};
// Dynamically load the libmqm_r library
let mq: Container<MqWrapper> = unsafe { Container::load("libmqm_r") }?;
// Connect to MQ
let mut hconn = mq::MQHC_DEF_HCONN;
let mut comp_code = mq::MQCC_UNKNOWN;
let mut reason = mq::MQRC_NONE;
let mut qmgr: mq::MQCHAR48 = [32; 48]; // All spaces
unsafe {
mq.MQCONN(
&qmgr,
&mut hconn,
&mut comp_code,
&mut reason,
);
}Structs§
- MqWrapper
- A dlopen2
WrapperApiimplementation for MQ function calls
Constants§
- MQM_LIB
- Name of the platform dependent MQM dynamic library
Traits§
- Load
MqmExt - Extension trait for
MqmContainerto load the MQM library using dlopen2
Type Aliases§
- MqmContainer
- A dlopen2 Container for the MQI library