rosu_render/request/
server_list.rs1use std::future::IntoFuture;
2
3use crate::{model::RenderServers, request::Request, routing::Route, ClientError, OrdrClient};
4
5use super::OrdrFuture;
6
7#[must_use]
9pub struct GetServerList<'a> {
10 ordr: &'a OrdrClient,
11}
12
13impl<'a> GetServerList<'a> {
14 pub(crate) const fn new(ordr: &'a OrdrClient) -> Self {
15 Self { ordr }
16 }
17}
18
19impl IntoFuture for &mut GetServerList<'_> {
20 type Output = Result<RenderServers, ClientError>;
21 type IntoFuture = OrdrFuture<RenderServers>;
22
23 fn into_future(self) -> Self::IntoFuture {
24 self.ordr.request(Request::from_route(Route::ServerList))
25 }
26}
27
28impl IntoFuture for GetServerList<'_> {
29 type Output = Result<RenderServers, ClientError>;
30 type IntoFuture = OrdrFuture<RenderServers>;
31
32 fn into_future(mut self) -> Self::IntoFuture {
33 (&mut self).into_future()
34 }
35}