modio/request/mods/comments/
delete_mod_comment.rs1use std::future::IntoFuture;
2
3use crate::client::Client;
4use crate::request::{Output, RequestBuilder, Route};
5use crate::response::{NoContent, ResponseFuture};
6use crate::types::id::{CommentId, GameId, ModId};
7
8pub struct DeleteModComment<'a> {
10 http: &'a Client,
11 game_id: GameId,
12 mod_id: ModId,
13 comment_id: CommentId,
14}
15
16impl<'a> DeleteModComment<'a> {
17 pub(crate) const fn new(
18 http: &'a Client,
19 game_id: GameId,
20 mod_id: ModId,
21 comment_id: CommentId,
22 ) -> Self {
23 Self {
24 http,
25 game_id,
26 mod_id,
27 comment_id,
28 }
29 }
30}
31
32impl IntoFuture for DeleteModComment<'_> {
33 type Output = Output<NoContent>;
34 type IntoFuture = ResponseFuture<NoContent>;
35
36 fn into_future(self) -> Self::IntoFuture {
37 let route = Route::DeleteModComment {
38 game_id: self.game_id,
39 mod_id: self.mod_id,
40 comment_id: self.comment_id,
41 };
42
43 match RequestBuilder::from_route(&route).empty() {
44 Ok(req) => self.http.request(req),
45 Err(err) => ResponseFuture::failed(err),
46 }
47 }
48}