LAST UPDATED: 2025-Aug-06
The aim of this project is to deliver a swiss army knife module to aid software engineers in building full stack solutions for their applications. Utilizing the Rust programming language, the module serves as a backbone to engineer solutions for multiple build targets.
The module serves as a consumable crate for software engineers to build their own custom backend / desktop services applications. Secondly built into the module is a Command Line Interface (CLI) to target script based solutions with a powerful CLI that will work the same regardless of the operating system. Lastly parts of the module along with the codemelted.js
implementing the codemelted
namespace will build a WASM / JS consumable modules to build powerful Single / Progressive Web Applications.
Table of Contents
- The
codemelted.rs
is a single file implementing the Domain Use Cases domain specific use cases. - These use cases straddle areas of knowledge software engineers should be familiar with regardless of a given programming language, SDK, or chosen framework.
- Each of the use cases are implemented as a series of
uc_xxx
functions reflecting the use case diagram above. - The
codemelted.rs
is organized by each implemented use case with data definitions first and function implementations after. - Each use case function is fully documented to include example code and mermaid diagrams.
- Any use case function that is currently being developed is marked as such.
You can access the use case functions via the codemelted::uc_xxx()
. The following example demonstrates utilizing the codemelted
module.
// Access the module objects of interest. In this case the logger module objects.
use codemelted::{CLogLevel, CLogRecord, CLoggedEventHandler};
// Setup a log handler for post logging.
fn log_handler(data: CLogRecord) {
// Do something, say post to the cloud about the event
}
codemelted::logger_set_log_handler(Some(log_handler));
// Set the log level
codemelted::logger_set_log_level(CLogLevel::Warning);
// Now later on in your code....
// This will be reported to the console and then to the CLoggedEventHandler.
codemelted::logger_log(CLogLevel::Error, "Oh Know!");
The above is a basic example. All modules are fully documented with examples as you use the codemelted crate.
- The
codemelted
crate does not utilizeasync
/await
/future
syntax. - Code is synchronous in the
codemelted
module allowing the software engineer to choose an appropriate thread model. - For asynchronous crates utilized by the
codemelted
module, they are transformed into synchronous APIs via thetokio::Runtime
. - For items requiring threading within the
codemelted
crate, they provide a synchronous API and implement the minimum threading necessary to achieve the module API goal.
The following sub-sections cover various aspects the codemelted.rs
module information. It is a single file implementation of the identified use cases.
The goal of the codemelted.rs
is to limit 3rd party items. However, some CodeMelted DEV use cases, thanks to the hard work of the developers who maintain the crates below, would not have been possible.
- btleplug: Supports the HW Domain Use Case providing the necessary interface to Bluetooth devices.
- chrono: Utilized to support the time formatting utilized in the Logger Domain Use Case.
- json: Forms the entire backbone of the Json Domain Use Case. The main
json::JsonValue
is typed alias asCObject
to match other CodeMelted DEV module implementations. - online: Utilized with the Runtime Domain Use Case to determine if an app has access to the Internet or not.
- reqwest: Supports the Network Domain Use Case fetch call forming the basis for both the request and response to a server REST API call.
- rouille: Supports the
network_serve
andnetwork_upgrade_web_socket
calls of the Network Domain Use Case forming the basis to upgrade a HTTP request wanting to upgrade to a bi-directional web socket. This will create aCWebSocketProtocol
that represents a bi-directional server socket. FYI: The following warning occurs with this crate. Will keep an eye out on updates with this crate, see if an assist can be made to the owner, or look for a new crate to utilize with the completedcodemelted.rs
module design.warning: the following packages contain code that will be rejected by a future version of Rust: buf_redux v0.8.4, multipart v0.18.0 note: to see what the problems were, use the option
--future-incompat-report
, or runcargo report future-incompatibilities --id 1
- rpassword: Supports the Console Domain Use Case to allow for getting a user's password from the console without reflecting it to the screen.
- rusqlite: Supports the DB Domain Use Case providing the ability to have an embedded sqlite database. The crate takes care of "installing" the items necessary to build the sqlite database file.
- simple-mermaid: Supports the crate documentation for the
codemelted.rs
file to include mermaid models where appropriate to help describe each of the modules. - serialport: Supports the HW Domain Use Case providing the necessary interface to Serial ports.
- sysinfo: This provides backbone for the Monitor Domain Use Case objects that support monitoring different aspects of a host operating system..
- tokio: Utilized to allow for the consumption of asynchronous crates and turn them into the
codemelted
crate synchronous design. - url: Supports url validation as part of the JSON Domain Use Case.
The versioning of the codemelted
crate will utilize a modified semantic versioning X.Y.Z
with the following rules for the numbering scheme.
- X: Year of release. Each new year resets the
Y.Z
values to1
- Y: Breaking change to one of the use case functions or upgrade of dependencies requiring considerations within an app. A change in this value resets
.Z
to1
. - Z: Bug fix, new use case function implemented, or expansion of a use case function. Continuously updated by adding one with each new release unless reset by
X.Y
changes.
MIT License
© 2025 Mark Shaffer
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
If you find this module useful, any support is greatly appreciated. Thank you! 🙇