Skip to main content

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#[allow(unused_imports)]
9use alloc::collections::BTreeMap;
10
11#[allow(unused_imports)]
12use core::marker::PhantomData;
13use jacquard_common::CowStr;
14use jacquard_derive::{IntoStatic, lexicon};
15use serde::{Serialize, Deserialize};
16
17#[lexicon]
18#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Default)]
19#[serde(rename_all = "camelCase")]
20pub struct VersionOutput<'a> {
21    #[serde(borrow)]
22    pub version: CowStr<'a>,
23}
24
25
26#[jacquard_derive::open_union]
27#[derive(
28    Serialize,
29    Deserialize,
30    Debug,
31    Clone,
32    PartialEq,
33    Eq,
34    thiserror::Error,
35    miette::Diagnostic,
36    IntoStatic
37)]
38
39#[serde(tag = "error", content = "message")]
40#[serde(bound(deserialize = "'de: 'a"))]
41pub enum VersionError<'a> {}
42impl core::fmt::Display for VersionError<'_> {
43    fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
44        match self {
45            Self::Unknown(err) => write!(f, "Unknown error: {:?}", err),
46        }
47    }
48}
49
50/// XRPC request marker type.
51
52#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, IntoStatic, Copy)]
53pub struct Version;
54/// Response type for sh.tangled.knot.version
55pub struct VersionResponse;
56impl jacquard_common::xrpc::XrpcResp for VersionResponse {
57    const NSID: &'static str = "sh.tangled.knot.version";
58    const ENCODING: &'static str = "application/json";
59    type Output<'de> = VersionOutput<'de>;
60    type Err<'de> = VersionError<'de>;
61}
62
63impl jacquard_common::xrpc::XrpcRequest for Version {
64    const NSID: &'static str = "sh.tangled.knot.version";
65    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
66    type Response = VersionResponse;
67}
68
69/// Endpoint type for sh.tangled.knot.version
70pub struct VersionRequest;
71impl jacquard_common::xrpc::XrpcEndpoint for VersionRequest {
72    const PATH: &'static str = "/xrpc/sh.tangled.knot.version";
73    const METHOD: jacquard_common::xrpc::XrpcMethod = jacquard_common::xrpc::XrpcMethod::Query;
74    type Request<'de> = Version;
75    type Response = VersionResponse;
76}