1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
use LinkedMq;
use ;
use crate::;
/// Create a connection to a queue manager using the compile time linked MQ library
/// and type inferred [`ConnectValue`].
///
/// This function uses the [`MQCONNX`](libmqm_sys::MQCONNX) MQ API function.
/// Create a connection to a queue manager using the compile time linked MQ library.
///
/// The connection parameters are controlled using a [`ConnectOption`]. Multiple [`ConnectOption`] can
/// be supplied using tuples of varying length.
///
/// The [`Threading`] type parameter controls the threaded capability of the connection.
///
/// This function uses the [`MQCONNX`](libmqm_sys::MQCONNX) verb.
///
/// ## Examples
///
/// ```no_run
/// use mqi::prelude::*;
/// use mqi::{connection::{ThreadNone, Credentials}, constants};
///
/// // Connect to the default queue manager with the provided credentials and MQCNO_RECONNECT_Q_MGR
/// let connection = mqi::connect::<ThreadNone>(&(
/// constants::MQCNO_RECONNECT_Q_MGR, Credentials::User("app", "app".into())
/// ))?;
///
/// // connection is wrapped in a Completion. Discard the completion with a `discard_warning`
/// let connection = connection.discard_warning();
///
/// # Ok::<(), mqi::result::Error>(())
/// ```
///
/// See also [`connect_as`] and [`connect_with`] for creating connections with additional
/// return attribute. For connections using dynamically loaded or custom implementation of the
/// MQ library refer to [`connect_lib`](crate::connect_lib).
///
/// ## Panics
/// This will panic when:
/// * Any MQ structure Version numbers exceed the compiled in MQ client
/// * Any MQ structure Offsets exceed the bounds of an [`MQLONG`](libmqm_sys::MQLONG)
/// Create a connection to a queue manager and return an implementation of [`ConnectAttr`] in tuple
/// using the compile time linked MQ library.
///
/// Refer to [`connect`] for parameter details.
///
/// This function uses the [`MQCONNX`](libmqm_sys::MQCONNX) MQ API function.
///
/// Common [`ConnectAttr`] that can be returned include [`ConnTag`](crate::connection::ConnTag) and [`ConnectionId`](crate::connection::ConnectionId).