thunderstore_api/models/v2/
render_markdown.rs

1////////////////////////////////////////////////////////////////////////////////
2// This Source Code Form is subject to the terms of the Mozilla Public         /
3// License, v. 2.0. If a copy of the MPL was not distributed with this         /
4// file, You can obtain one at https://mozilla.org/MPL/2.0/.                   /
5////////////////////////////////////////////////////////////////////////////////
6
7#[cfg(feature = "ts-rs")]
8use ts_rs::TS;
9
10#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)]
11#[cfg_attr(feature = "ts-rs", derive(TS))]
12#[cfg_attr(feature = "ts-rs", ts(export))]
13pub struct RenderMarkdownParams {
14    pub markdown: String,
15}
16
17impl RenderMarkdownParams {
18    #[must_use]
19    pub fn new(markdown: String) -> RenderMarkdownParams {
20        RenderMarkdownParams { markdown }
21    }
22}
23
24#[derive(Clone, Debug, PartialEq, Eq, Default, Serialize, Deserialize)]
25#[cfg_attr(feature = "ts-rs", derive(TS))]
26#[cfg_attr(feature = "ts-rs", ts(export))]
27pub struct RenderMarkdownResponse {
28    pub html: String,
29}
30
31impl RenderMarkdownResponse {
32    #[must_use]
33    pub fn new(html: String) -> RenderMarkdownResponse {
34        RenderMarkdownResponse { html }
35    }
36}