Skip to main content

parse_claude_input

Function parse_claude_input 

Source
pub fn parse_claude_input(json_str: &str) -> Result<ClaudeInput, CoreError>
Expand description

Parses JSON string into ClaudeInput structure

Takes raw JSON input from stdin and deserializes it into a strongly typed ClaudeInput struct.

§Arguments

  • json_str - Raw JSON string to parse

§Returns

  • Ok(ClaudeInput) - Successfully parsed input
  • Err - JSON parsing or validation failed

§Examples

use claude_code_statusline_core::parse_claude_input;

let json = r#"{"session_id":"test","cwd":"/tmp","model":{"id":"claude","display_name":"Claude"}}"#;
let input = parse_claude_input(json).unwrap();
assert_eq!(input.cwd, "/tmp");