Crate neutralipcrs

Crate neutralipcrs 

Source
Expand description

Neutral IPC Template package.

This crate provides a Rust client for the Neutral template engine, which processes templates via Inter-Process Communication (IPC). The client communicates with a Neutral server to render templates with JSON data schemas.

§Examples

use neutralipcrs::NeutralIpcTemplate;
use serde_json::json;

let schema = json!({
    "data": {
        "text": "World"
    }
});

let mut template = NeutralIpcTemplate::from_src_value("Hello {:;text:}!", schema).unwrap();
let result = template.render().unwrap();

println!("{}", result); // Output: "Hello World!"

§Configuration

The client reads the server configuration from /etc/neutral-ipc-cfg.json to determine connection settings (host and port).

Re-exports§

pub use config::NeutralIpcConfig;
pub use template::NeutralIpcTemplate;
pub use constants::*;

Modules§

client
IPC client implementation for communicating with the Neutral template server.
config
Configuration module for Neutral IPC client. Reads configuration from /etc/neutral-ipc-cfg.json or uses default values. neutral-ipc-cfg.json is the configuration file used by the IPC server.
constants
Constants for Neutral IPC record protocol.
template
High-level template processing interface.

Enums§

NeutralIpcError
Error types for Neutral IPC client operations.