Neutral TS Rust IPC Client
Neutral IPC Client is a Rust library that provides a client for the Neutral template engine via Inter-Process Communication (IPC). It allows you to render templates using a language-agnostic approach, communicating with a Neutral IPC server to process templates with JSON or MsgPack data schemas.
Features
- IPC Communication: Connect to a Neutral template server via TCP
- Flexible Schema Support: Use JSON or MsgPack data formats
- Template Sources: Load templates from files or inline strings
- Schema Merging: Incrementally build complex schemas with deep merge support
- Status Handling: Retrieve status codes, messages, and parameters from rendered templates
- Configurable: Customize connection settings (host, port, timeout, buffer size)
- Safe & Reliable: Built with Rust's type safety and comprehensive error handling
Rust IPC use
use NeutralIpcTemplate;
use json;
let schema = json!;
let mut template = from_file_value.unwrap;
let contents = template.render.unwrap;
// e.g.: 200
let status_code: &str = template.get_status_code;
// e.g.: OK
let status_text: &str = template.get_status_text;
// empty if no error
let status_param: &str = template.get_status_param;
// act accordingly at this point according to your framework
Rust IPC with MsgPack schema
use NeutralIpcTemplate;
use json;
let schema = json!;
let schema_msgpack = to_vec.unwrap;
let mut template = from_src_msgpack.unwrap;
let contents = template.render.unwrap;
assert_eq!;
- Requires the IPC server: Neutral TS IPC Server
- Requires the Rust IPC client: Neutral TS Rust IPC Client