Module dlopen2

Source
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 WrapperApi implementation for MQ function calls

Constants§

MQM_LIB
Name of the platform dependent MQM dynamic library

Traits§

LoadMqmExt
Extension trait for MqmContainer to load the MQM library using dlopen2

Type Aliases§

MqmContainer
A dlopen2 Container for the MQI library