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

§✅ 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 macro
  • venus::prelude::* module
  • Render trait 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 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;

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.