Skip to main content

HARNESS_TEMPLATE

Constant HARNESS_TEMPLATE 

Source
pub const HARNESS_TEMPLATE: &'static str;
Available on crate feature code only.
Expand description

The harness template that wraps user code.

The user provides fn run(input: serde_json::Value) -> serde_json::Value. The harness reads JSON from stdin, calls run(), and prints JSON to stdout.

§Available to User Code

  • serde_json::Value (imported at top level)
  • All public items from serde_json (e.g., serde_json::json!, serde_json::Map)
  • The full Rust standard library

§Not Available

  • External crates other than serde_json
  • fn main() (provided by the harness)
  • Crate-level attributes (#![...])
  • Multi-file modules