lichess_api/api/
openings.rs1use futures::stream::StreamExt;
11
12use crate::client::LichessApi;
13use crate::error::Result;
14use crate::model::openings::*;
15
16impl LichessApi<reqwest::Client> {
17 pub async fn openings_masters(
18 &self,
19 request: impl Into<masters::GetRequest>,
20 ) -> Result<OpeningExplorerJson> {
21 self.get_single_model(request.into()).await
22 }
23
24 pub async fn openings_lichess(
25 &self,
26 request: impl Into<lichess::GetRequest>,
27 ) -> Result<OpeningExplorerJson> {
28 self.get_single_model(request.into()).await
29 }
30
31 pub async fn openings_player(
32 &self,
33 request: impl Into<player::GetRequest>,
34 ) -> Result<OpeningExplorerJson> {
35 self.get_single_model(request.into()).await
36 }
37
38 pub async fn openings_otb(
39 &self,
40 request: impl Into<otb::GetRequest>,
41 ) -> Result<impl StreamExt<Item = Result<String>>> {
42 self.get_pgn(request.into()).await
43 }
44}