CI Status Github Stars MIT License

Banner

rearch = re-imagined approach to application design and architecture


Features

Specifically, rearch is a: - ⚡️ Reactive - 🧮 Functional - 🔍 Testable - 🧱 Composable - 🔌 Extendable - ⬆️ Scalable - 💉 Dependency Injection

Framework.

Under Construction

This README is a large WIP, but there are some basics here.

Getting Started

First, you need to define some "capsules."

There are two ways to define capsules, depending on your toolchain. Both are 100% compatible with each other, and will continue to be in the future as well (forward compatability was a very strong factor when designing the api).

Nightly Rust (better-api feature)

Once unboxed_closures and fn_traits stabilize, this nightly syntax will be the preferred syntax (over the current stable syntax), and this will no longer be feature-gated. ```rust fn count(CapsuleHandle { register, .. }: CapsuleHandle) -> (u8, impl Fn(u8) + Clone + Send + Sync) { let (state, setstate) = register(sideeffects::state(0)); (*state, set_state) }

fn countplusone(CapsuleHandle { mut get, .. }: CapsuleHandle) -> u8 { get(count).0 + 1 }

let container = Container::new(); let ((count, setcount), countplusone) = container.read((count, countplus_one)); ```

Stable Rust

Once unboxed_closures and fn_traits stabilize, the below will be deprecated in favor of the now nightly-only syntax (backward compatability will be maintained). ```rust fn count(CapsuleHandle { register, .. }: CapsuleHandle) -> (u8, impl Fn(u8) + Clone + Send + Sync) { let (state, setstate) = register.register(sideeffects::state(0)); (*state, set_state) }

fn countplusone(CapsuleHandle { mut get, .. }: CapsuleHandle) -> u8 { get.get(count).0 + 1 }

let container = Container::new(); let ((count, setcount), countplusone) = container.read((count, countplus_one)); ```