icedwright-protocol 0.1.0

Wire types for icedwright: the raw semantic tree a live app records and the typed remote protocol
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use icedwright_protocol::__private::methods_unique;
use icedwright_protocol::{Call, Hello, PROTOCOL, Request, RequestId, METHODS};

const _: () = assert!(methods_unique(METHODS));

fn response_of<R: Request>(_: &R) -> &'static str {
    R::METHOD
}

fn main() {
    let hello = Hello {
        protocol: PROTOCOL,
        client: "test".to_owned(),
        os_keyboard: false,
    };
    assert_eq!(response_of(&hello), "hello");
    let _call: Call<Hello> = Call::new(RequestId(1), hello);
}