kode-bridge 0.4.0

Modern HTTP Over IPC library for Rust with both client and server support (Unix sockets, Windows named pipes).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use crate::errors::AnyResult;
use serde::{Deserialize, Serialize};
use serde_json::Value;

/// Legacy response format for backward compatibility
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct LegacyResponse {
    pub status: u16,
    pub headers: Value,
    pub body: String,
}

impl LegacyResponse {
    pub fn json(&self) -> AnyResult<Value> {
        serde_json::from_str(&self.body).map_err(Into::into)
    }
}