| Crates.io | runmod |
| lib.rs | runmod |
| version | 1.2.0 |
| created_at | 2025-11-14 06:44:11.36972+00 |
| updated_at | 2025-11-19 05:20:30.31867+00 |
| description | A rust libary to speed up development |
| homepage | |
| repository | https://github.com/inyourface34456/runmod |
| max_upload_size | |
| id | 1932386 |
| size | 617,040 |
This is a simple crate that will allow you to change values in your program and have them update in real time when you change values in your source code.
For now only numbers types are suported (i.e., your ix, ux, and fx). I do plan on adding string suport at a later date if I ever get around to it.
EDIT: Strings are now suported (utf-8 only for now)
Here is a basic usage example:
use runmod::{RunMod, RunVar};
fn main() {
let mut val = RunMod::new(RunVar::I32(42));
while val.get_i32().unwrap() == 42 {
println!("val: {}", val.get_i32().unwrap());
// this will run untill you change the value in the program
break // if this is not here, then rustdoc will not exit
}
}
Right now it uses std::panic::Location::caller() (an api I bet you never new exsisted) and
the #[track_caller] macro (the only way this works) to get the file and location where the
varible is made, and every time you call .get_[type] it reads the file, skips to the line
with the varible decelration and uses regex to parse it. Tis can cause panics, but only if
you use a varible instead of a number like this:
use runmod::{RunMod, RunVar};
let val = 42;
let mut runvar = RunMod::new(RunVar::I32(val));
runvar.get_i32();
This fails due to lexical parser not knowing what do to to convert a string into a number (i will accept PRs that can add this functionality while maintaning speed).