File: 06-response-only.rs

package info (click to toggle)
rust-ruma-common 0.10.5-9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,208 kB
  • sloc: makefile: 2
file content (24 lines) | stat: -rw-r--r-- 542 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
use ruma_common::api::ruma_api;

ruma_api! {
    metadata: {
        description: "Does something.",
        method: POST, // An `http::Method` constant. No imports required.
        name: "some_endpoint",
        unstable_path: "/_matrix/some/endpoint/:baz",
        rate_limited: false,
        authentication: None,
    }

    #[derive(PartialEq)] // Make sure attributes work
    response: {
        pub flag: bool,
    }
}

fn main() {
    let res1 = Response { flag: false };
    let res2 = res1.clone();

    assert_eq!(res1, res2);
}