Crate venus

Crate venus 

Source
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 .rs files, so rust-analyzer works out of the box
  • Fast compilation: Cranelift JIT for sub-second feedback
  • Hot reload: Modify code without losing state

§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 returns T
  • fn bar(a: &A, b: &B) depends on cells returning A and B

The parameter name must match the producing cell’s function name.

Re-exports§

pub use render::Render;
pub use widgets::input_checkbox;
pub use widgets::input_checkbox_labeled;
pub use widgets::input_select;
pub use widgets::input_select_labeled;
pub use widgets::input_slider;
pub use widgets::input_slider_labeled;
pub use widgets::input_slider_with_step;
pub use widgets::input_text;
pub use widgets::input_text_labeled;
pub use widgets::input_text_with_default;

Modules§

prelude
Common imports for Venus notebooks.
render
Rich output rendering for notebook cells.
widgets
Interactive widgets for Venus notebooks.

Attribute Macros§

cell
Marks a function as a notebook cell.