streamduck_core/
versions.rs

1//! Constants for defining current feature versions of the software
2//!
3//! This is used heavily with plugin compatibility checking, please report features your plugins use correctly.
4//! If version of one of the listed features updates and your plugin is using it, it will be deemed incompatible.
5//! This is made to ensure that the program will not crash because of API differences between plugin and the core.
6//!
7//! Versions here do not represent how up to date the features are, versions here are just for making sure plugins
8//! are not using unsupported API.
9
10/// Compiler version used to compile the project, make sure you're using same toolchain version as specified here (1.64)
11///
12/// Rust doesn't have a stable ABI yet, so only way to ensure that data is ordered the same way,
13/// is to use same version of the compiler
14pub const COMPILER_VERSION: (&str, &str) = ("compiler_version", "1.64");
15/// API related to plugin definition and initialization, will be updated very rarely if ever
16pub const PLUGIN_API: (&str, &str) = ("plugin_api", "0.2");
17/// SDModule trait version, will be updated everytime there's a change to the module trait
18pub const SDMODULE_TRAIT: (&str, &str) = ("sdmodule_trait", "0.2");
19/// Core version, will be updated everytime there's change to core struct, probably never
20pub const CORE: (&str, &str) = ("core", "0.2");
21/// Core methods version, will be updated everytime there's changes to existing functions or functions get deleted
22pub const CORE_METHODS: (&str, &str) = ("core_methods", "0.2");
23/// Config, will be updated everytime there's changes to existing functions or functions get deleted
24pub const CONFIG: (&str, &str) = ("config", "0.2");
25/// Module manager, will be updated everytime there's changes to existing functions or functions get deleted
26pub const MODULE_MANAGER: (&str, &str) = ("module_manager", "0.2");
27/// Core events, will be updated everytime there's changes to existing events or an event was removed
28pub const CORE_EVENTS: (&str, &str) = ("core_events", "0.2");
29/// Global events, will be updated everytime there's changes to existing events or an event was removed
30pub const GLOBAL_EVENTS: (&str, &str) = ("global_events", "0.1");
31/// Socket API of daemon, mostly used for socket communication, will be updated everytime there's changes to existing requests or a request was removed
32pub const SOCKET_API: (&str, &str) = ("socket_api", "0.2");
33/// Rendering version, will be updated everytime there's changes to existing rendering API for plugins
34pub const RENDERING: (&str, &str) = ("rendering", "0.2");
35
36/// Constant array of currently supported features, can also be used for plugin to specify using all of the features
37pub const SUPPORTED_FEATURES: &[(&str, &str)] = &[
38    COMPILER_VERSION,
39    PLUGIN_API,
40    SDMODULE_TRAIT,
41    CORE,
42    CORE_METHODS,
43    CONFIG,
44    MODULE_MANAGER,
45    CORE_EVENTS,
46    GLOBAL_EVENTS,
47    RENDERING,
48    SOCKET_API
49];