1#![deny(missing_docs)]
2#![warn(clippy::pedantic)]
3#![doc = include_str!("../README.md")]
4
5pub use dynamic_plugin_macros::*;
7pub use const_format::concatcp as const_concat;
8
9pub use libloading::Library as PluginDynamicLibrary;
11pub use libloading::Symbol as PluginLibrarySymbol;
12
13pub use libc;
15
16pub type Result<T> = std::result::Result<T, Error>;
18
19#[derive(Debug, thiserror::Error)]
21pub enum Error {
22    #[error("An error while calling the plugin library: {0}")]
24    DynamicLibrary(#[from] libloading::Error),
25
26    #[error("The discovered library is not a plugin.")]
28    NotAPlugin,
29
30    #[error("The plugin's signature does not match.")]
32    InvalidPluginSignature,
33}
34
35#[macro_export]
39macro_rules! static_assert {
40    ($exp:expr, $msg:expr) => {
41        #[deny(const_err)]
42        #[allow(unused_must_use)]
43        const _: () = {
44            if !($exp) {
45                core::panic!("{}", $msg);
46            }
47
48            ()
49        };
50    };
51}