#![deny(missing_docs)]
#![allow(non_upper_case_globals)]
#![allow(non_camel_case_types)]
#![allow(non_snake_case)]
#![allow(clippy::unnecessary_cast)]
#[macro_use]
extern crate log;
extern crate paho_mqtt_sys as ffi;
pub use async_channel::Receiver as AsyncReceiver;
pub use crossbeam_channel::Receiver;
pub use crate::async_client::*; pub use crate::client::*; pub use crate::client_persistence::*;
pub use crate::connect_options::*; pub use crate::create_options::*; pub use crate::disconnect_options::*; pub use crate::errors::*;
pub use crate::message::*; pub use crate::name_value::*; pub use crate::properties::*; pub use crate::reason_code::*; pub use crate::response_options::*; pub use crate::server_response::*; pub use crate::ssl_options::*; pub use crate::subscribe_options::*; pub use crate::token::*; pub use crate::topic::*; pub use crate::topic_matcher::TopicMatcher;
pub use crate::types::*; pub use crate::will_options::*;
use std::{any::Any, os::raw::c_int};
mod macros;
pub mod async_client;
pub mod client;
pub mod create_options;
pub mod connect_options;
pub mod will_options;
pub mod ssl_options;
pub mod disconnect_options;
pub mod subscribe_options;
pub mod response_options;
pub mod server_response;
pub mod properties;
pub mod message;
pub mod token;
pub mod topic;
pub mod topic_matcher;
pub mod reason_code;
pub mod types;
pub mod client_persistence;
pub mod errors;
pub mod string_collection;
pub mod name_value;
pub type UserData = Box<dyn Any + 'static + Send + Sync>;
pub fn to_c_bool(on: bool) -> c_int {
c_int::from(on)
}
pub fn from_c_bool(on: c_int) -> bool {
on != 0
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_to_c_bool() {
assert_eq!(1, to_c_bool(true));
assert_eq!(0, to_c_bool(false));
}
#[test]
fn test_from_c_bool() {
assert!(from_c_bool(1));
assert!(from_c_bool(42));
assert!(!from_c_bool(0));
}
}