jacquard_api/sh_tangled/knot/
version.rs

1// @generated by jacquard-lexicon. DO NOT EDIT.
2//
3// Lexicon: sh.tangled.knot.version
4//
5// This file was automatically generated from Lexicon schemas.
6// Any manual changes will be overwritten on the next regeneration.
7
8#[jacquard_derive::lexicon]
9#[derive(
10    serde::Serialize,
11    serde::Deserialize,
12    Debug,
13    Clone,
14    PartialEq,
15    Eq,
16    jacquard_derive::IntoStatic
17)]
18#[serde(rename_all = "camelCase")]
19pub struct VersionOutput<'a> {
20    #[serde(borrow)]
21    pub version: jacquard_common::CowStr<'a>,
22}
23
24#[jacquard_derive::open_union]
25#[derive(
26    serde::Serialize,
27    serde::Deserialize,
28    Debug,
29    Clone,
30    PartialEq,
31    Eq,
32    thiserror::Error,
33    miette::Diagnostic,
34    jacquard_derive::IntoStatic
35)]
36#[serde(tag = "error", content = "message")]
37#[serde(bound(deserialize = "'de: 'a"))]
38pub enum VersionError<'a> {}
39impl std::fmt::Display for VersionError<'_> {
40    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
41        match self {
42            Self::Unknown(err) => write!(f, "Unknown error: {:?}", err),
43        }
44    }
45}
46
47/// XRPC request marker type
48#[derive(
49    Debug,
50    Clone,
51    Copy,
52    PartialEq,
53    Eq,
54    serde::Serialize,
55    serde::Deserialize,
56    jacquard_derive::IntoStatic
57)]
58pub struct Version;
59///Response type for
60///sh.tangled.knot.version
61pub struct VersionResponse;
62impl jacquard_common::xrpc::XrpcResp for VersionResponse {
63    const NSID: &'static str = "sh.tangled.knot.version";
64    const ENCODING: &'static str = "application/json";
65    type Output<'de> = VersionOutput<'de>;
66    type Err<'de> = VersionError<'de>;
67}
68
69impl<'de> jacquard_common::xrpc::XrpcRequest<'de> for Version {
70    const NSID: &'static str = "sh.tangled.knot.version";
71    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
72    type Response = VersionResponse;
73}
74
75///Endpoint type for
76///sh.tangled.knot.version
77pub struct VersionRequest;
78impl jacquard_common::xrpc::XrpcEndpoint for VersionRequest {
79    const PATH: &'static str = "/xrpc/sh.tangled.knot.version";
80    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
81    type Request<'de> = Version;
82    type Response = VersionResponse;
83}