@@ -19,3 +19,10 @@ target
|
||||
# and can be added to the global gitignore or merged into this file. For a more nuclear
|
||||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||
#.idea/
|
||||
|
||||
|
||||
# Added by cargo
|
||||
|
||||
/target
|
||||
|
||||
.mist
|
||||
|
||||
Generated
+14
@@ -0,0 +1,14 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "pulse-trader"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"pulse-ui",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "pulse-ui"
|
||||
version = "0.1.0-alpha.0"
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
[package]
|
||||
name = "pulse-trader"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[workspace]
|
||||
members = ["pulse-ui"]
|
||||
|
||||
[workspace.dependencies]
|
||||
pulse-ui = { path = "pulse-ui", version = "0.1.0-alpha.0" }
|
||||
|
||||
[dependencies]
|
||||
pulse-ui = { workspace = true }
|
||||
|
||||
[[bin]]
|
||||
name = "pulse-trader"
|
||||
path = ".mist/src/main.rs"
|
||||
@@ -0,0 +1,10 @@
|
||||
[package]
|
||||
name = "pulse-ui"
|
||||
version = "0.1.0-alpha.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
||||
|
||||
[lib]
|
||||
name = "pulse_ui"
|
||||
path = ".mist/src/lib.rs"
|
||||
@@ -0,0 +1,3 @@
|
||||
package = "lib.mist"
|
||||
packages = []
|
||||
include = []
|
||||
@@ -0,0 +1,25 @@
|
||||
pub module state_management;
|
||||
|
||||
use std::sync::Arc;
|
||||
use std::sync::Mutex;
|
||||
use std::sync::LockResult;
|
||||
use std::sync::MutexGuard;
|
||||
|
||||
pub trait Dependent
|
||||
{
|
||||
void update(&self);
|
||||
}
|
||||
|
||||
pub struct State<T>
|
||||
{
|
||||
pub Box<dyn Dependent> dependent;
|
||||
pub Arc<Mutex<T>> data;
|
||||
}
|
||||
|
||||
impl<T> State<T>
|
||||
{
|
||||
LockResult<MutexGuard<'_, T>> lock(&self)
|
||||
{
|
||||
self.data.lock()
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
pub void test() {
|
||||
println!("Hello, World");
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
void main() {
|
||||
println!("Hello, World!");
|
||||
|
||||
pulse_ui::test();
|
||||
}
|
||||
Reference in New Issue
Block a user