Expand description
Venus: A reactive notebook environment for Rust.
Venus provides an interactive notebook experience with:
- Reactive execution: Cells automatically re-execute when dependencies change
- Full IDE support: Uses
.rsfiles, so rust-analyzer works out of the box - Fast compilation: Cranelift JIT for sub-second feedback
- Hot reload: Modify code without losing state
§✅ API Stability
This crate provides the STABLE user-facing API for Venus notebooks.
Starting from 0.1.0, the following APIs are considered stable:
#[venus::cell]proc macrovenus::prelude::*moduleRendertrait and its derive macro- Widget functions (
input_slider,input_text, etc.)
Stability guarantees:
- ✅ SemVer compliance - breaking changes only in major versions (1.0, 2.0, etc.)
- ✅ Deprecation warnings - minimum 1 minor version warning before removal
- ✅ Documented migrations - clear upgrade paths for breaking changes
For internal APIs (compilation, execution, state management), see the venus-core crate,
which is UNSTABLE and may change without notice.
§Quick Start
ⓘ
use venus::prelude::*;
/// Load configuration
#[venus::cell]
pub fn config() -> Config {
Config::default()
}
/// Process data using config
#[venus::cell]
pub fn process(config: &Config) -> Result<Data, Error> {
// config is automatically passed from the config() cell
load_and_process(&config.path)
}§Cell Dependencies
Dependencies are inferred from function parameters:
fn foo(x: &T)depends on a cell that returnsTfn bar(a: &A, b: &B)depends on cells returningAandB
The parameter name must match the producing cell’s function name.
Re-exports§
pub use render::Render;
Modules§
- prelude
- Common imports for Venus notebooks.
- render
- Rich output rendering for notebook cells.
- widgets
- Interactive widgets for Venus notebooks.
Functions§
- input_
checkbox - Create a checkbox widget.
- input_
checkbox_ labeled - Create a checkbox widget with custom label.
- input_
select - Create a dropdown select widget.
- input_
select_ labeled - Create a dropdown select widget with custom label.
- input_
slider - Create a numeric slider widget.
- input_
slider_ labeled - Create a numeric slider widget with custom label.
- input_
slider_ with_ step - Create a numeric slider widget with custom step.
- input_
text - Create a text input widget.
- input_
text_ labeled - Create a text input widget with custom label.
- input_
text_ with_ default - Create a text input widget with a default value.
Attribute Macros§
- cell
- Marks a function as a notebook cell.