freedom_api/extensions/
band.rs

1use crate::{Api, error::Error};
2use freedom_models::{account::Account, band::Band};
3
4pub trait BandExt {
5    fn get_id(&self) -> Result<i32, Error>;
6
7    fn get_account<C>(
8        &self,
9        client: &C,
10    ) -> impl Future<Output = Result<Account, Error>> + Send + Sync
11    where
12        C: Api;
13}
14
15impl BandExt for Band {
16    fn get_id(&self) -> Result<i32, Error> {
17        super::get_id("self", &self.links)
18    }
19
20    async fn get_account<C>(&self, client: &C) -> Result<Account, Error>
21    where
22        C: Api,
23    {
24        super::get_content("account", &self.links, client).await
25    }
26}