Add api_url() method to raw::Client and wrapper::ListenBrainz
This commit is contained in:
parent
0b18a3230b
commit
0c3125bd14
|
@ -38,6 +38,11 @@ impl Client {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get the API URL of this client.
|
||||||
|
pub fn api_url(&self) -> &str {
|
||||||
|
&self.api_root_url
|
||||||
|
}
|
||||||
|
|
||||||
/// Helper method to perform a GET request against an endpoint
|
/// Helper method to perform a GET request against an endpoint
|
||||||
/// without any query parameters.
|
/// without any query parameters.
|
||||||
fn get<R: ResponseType>(&self, endpoint: Endpoint) -> Result<R, Error> {
|
fn get<R: ResponseType>(&self, endpoint: Endpoint) -> Result<R, Error> {
|
||||||
|
|
|
@ -40,6 +40,11 @@ impl ListenBrainz {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get the API URL of this client.
|
||||||
|
pub fn api_url(&self) -> &str {
|
||||||
|
self.client.api_url()
|
||||||
|
}
|
||||||
|
|
||||||
/// Check if this client is authenticated.
|
/// Check if this client is authenticated.
|
||||||
pub fn is_authenticated(&self) -> bool {
|
pub fn is_authenticated(&self) -> bool {
|
||||||
self.auth.is_some()
|
self.auth.is_some()
|
||||||
|
|
Loading…
Reference in New Issue