Crates.io | libmqm-sys |
lib.rs | libmqm-sys |
version | 0.3.0 |
source | src |
created_at | 2024-04-19 12:10:30.601245 |
updated_at | 2024-05-23 06:34:26.071969 |
description | Native bindings to the IBM® MQ Interface (MQI) and MQ Administration Interface (MQAI) |
homepage | |
repository | https://github.com/advantic-au/libmqm-sys |
max_upload_size | |
id | 1213619 |
size | 753,689 |
Native bindings to the IBM® MQ Interface (MQI) and MQ Administration Interface (MQAI)
You can use libmqm-sys
to:
Functions provided in this crate are the raw unsafe
functions exposed from the
IBM provided library. Developers should build safe rust API wrappers over these functions.
Compile time dynamic linking and run-time dynamic linking is supported.
Download and install the redistributable client from IBM: https://ibm.biz/mq93redistclients
Install the client in /opt/mqm
or another location.
Set the MQ_HOME environment variable to the installed location.
MQ_HOME=/opt/mqm
Add the following to your Cargo.toml
[dependencies]
libmqm-sys = "0.3.0"
Use the crate in your source code:
use libmqm-sys as mqsys;
#[cfg(test)]
mod test {
use std::ptr::addr_of_mut;
use libmqm_sys::lib;
#[test]
fn connect() {
unsafe {
let mut hconn = lib::MQHC_DEF_HCONN;
let mut comp_code = lib::MQCC_UNKNOWN;
let mut reason = lib::MQRC_NONE;
let mut qmgr: [i8; 48] = [b' '; 48]; // All spaces
lib::MQCONN(
addr_of_mut!(qmgr).cast(),
addr_of_mut!(hconn),
addr_of_mut!(comp_code),
addr_of_mut!(reason),
);
assert_eq!(reason, lib::MQRC_NONE, "MQRC");
assert_eq!(comp_code, lib::MQCC_OK, "MQCC");
lib::MQDISC(addr_of_mut!(hconn), addr_of_mut!(comp_code), addr_of_mut!(reason));
};
}
}
Feature | Description |
---|---|
link (default) | Support linking the MQ library at compile-time |
bindgen (default) | Generate the bindings from MQI library |
dlopen2 | Support loading the MQ library at run-time using dlopen2 |
mqai | Expose the MQAI functions |
pcf | Generate the PCF structures |
exits | Generate the exit structures |
The following needs further work:
All feedback, suggestions, contributions and enhancements are welcome.
There are no guarantees of compatibility with any future versions of the crate; the API is subject to change based on feedback and enhancements. Relentless refactoring may occur before a stable crate is released.
This crate is provided as-is with no guarantees of support or updates.
This crate is not approved, endorsed, acknowledged, or supported by IBM. You cannot use IBM formal support channels (Cases/PMRs) for assistance on the use of this crate.
Licensed under