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
//!
//! The Fundamentum's MQTT SDK is designed to quickly set up a Rust environment with an MQTT client, focusing on consuming Fundamentum's MQTT services.
//!
//! # Getting Started
//!
//! To get started with the SDK, you'll need to install Rust. You can follow the instructions on the official Rust website: [Install Rust](https://www.rust-lang.org/tools/install).
//!
//! ## Example
//!
//! To test your environment, you can build and run a simple command-line application. Check out the [examples](./examples/) directory for code samples.
//! ```bash
//! cargo run --example pubsub -- --private-key ./mqtt/assets/rsa_private.pem --project-id 13 --region-id 1 --registry-id 12 --serial 123456789
//! ```
//!
//! ### Examples
//!
//! * `pubsub`: an advanced example with heartbeat and pub/sub pattern.
//! * `commands`: a basic example with the commands workflow.
//! * `heartbeat`: a very simple example with the heartbeat.
//!

// clippy warning level lints
#![warn(
    missing_docs,
    clippy::pedantic,
    clippy::nursery,
    clippy::dbg_macro,
    clippy::unwrap_used,
    clippy::map_err_ignore,
    clippy::unimplemented,
    clippy::unreachable,
    clippy::clone_on_ref_ptr,
    clippy::create_dir,
    clippy::exit,
    clippy::filetype_is_file,
    clippy::float_cmp_const,
    clippy::indexing_slicing,
    clippy::let_underscore_must_use,
    clippy::lossy_float_literal,
    clippy::pattern_type_mismatch,
    clippy::string_slice,
    clippy::try_err
)]
// clippy deny/error level lints, they always have  quick fix that should be preferred
#![deny(
    clippy::multiple_inherent_impl,
    clippy::rc_buffer,
    clippy::rc_mutex,
    clippy::rest_pat_in_fully_bound_structs,
    clippy::same_name_method,
    clippy::self_named_module_files,
    clippy::separated_literal_suffix,
    clippy::str_to_string,
    clippy::string_add,
    clippy::string_to_string,
    clippy::unnecessary_self_imports,
    clippy::unneeded_field_pattern,
    clippy::verbose_file_reads
)]
#![allow(
       // allowed rules
       clippy::module_name_repetitions,
       clippy::similar_names
   )]

mod client;
mod device;
mod error;
mod message;
mod security;

pub use client::{async_event_loop_listener, Client, ClientSettings};
pub use device::Device;
pub use error::Error;
pub use message::Message;
pub use rumqttc::{EventLoop, Packet, Publish, QoS};
pub use security::{
    Security, SecurityBuilder, SecurityBuilderError, SecurityFetcher, SecurityFileFetcher,
};
pub use serde_json::json;

pub mod models;