Skip to content

Rust Documentation

Complete API Reference

This section contains the complete Rust documentation for all Nerve Framework components, generated using cargo doc.

Available Documentation

Core Components

System Components

Generating Documentation

To generate the Rust documentation locally:

# Generate documentation
cargo doc --no-deps --open

# Generate with all features
cargo doc --all-features --no-deps

# Generate for specific component
cargo doc -p nerve-communication --open

Documentation Structure

Each component's documentation includes:

  • Module Overview - High-level component description
  • Structs and Enums - Data structures and types
  • Traits - Interfaces and contracts
  • Functions - Public API methods
  • Examples - Usage examples and patterns
  • Implementation Details - Internal architecture notes

Key API Sections

Communication System

use nerve::communication::pubsub::{Publisher, Subscriber};
use nerve::communication::qos::QoS;

// Publisher API
let publisher = Publisher::new();
publisher.publish("topic", "message").await?;

// Subscriber API
let subscriber = Subscriber::new();
subscriber.subscribe("topic").await?;
let message = subscriber.receive().await;

Memory Management

use nerve::memory::MessageBuffer;
use nerve::memory::qos::QoSPolicy;

// Buffer creation
let buffer = MessageBuffer::new(1000, QoSPolicy::BestEffort);

// Message operations
buffer.push(message).await?;
let message = buffer.pop().await;

Node Registry

use nerve::node::Registry;
use nerve::node::NodeInfo;

// Registry operations
let registry = Registry::new();
registry.register_node(node_info).await?;
let nodes = registry.get_nodes().await;

Search and Navigation

The generated documentation supports:

  • Full-text search - Search across all components
  • Type navigation - Click through type definitions
  • Source links - View source code implementations
  • Cross-references - Link between related components

Integration with MkDocs

This documentation is integrated with the main MkDocs site, providing:

  • Unified navigation - Seamless browsing between guides and API docs
  • Search integration - Combined search across all documentation
  • Consistent styling - Material theme applied to Rust documentation

Next Steps


Note: The actual Rust documentation links will work once cargo doc is run to generate the HTML files.