[−][src]Struct apod_async_client::APODClient
An asynchronous client for NASA "Astronomy Picture Of the Day" service
Methods
impl APODClient
[src]
pub fn new<S>(api_key: S) -> Self where
S: Into<Cow<'static, str>>,
[src]
S: Into<Cow<'static, str>>,
Build a client using the provided api_key
.
api_key
can be passed as a &'static str
or as a owned String
Example
use apod_async_client::APODClient; APODClient::new("DEMO_KEY"); APODClient::new(String::from("DEMO_KEY"));
pub fn config<SA, SB>(base_url: SA, api_key: SB) -> Self where
SA: Into<Cow<'static, str>>,
SB: Into<Cow<'static, str>>,
[src]
SA: Into<Cow<'static, str>>,
SB: Into<Cow<'static, str>>,
Build a client by overriding server base_url
and providing api_key
pub async fn get_picture<'_, '_>(
&'_ self,
date: &'_ Date,
hd: bool
) -> Result<(APODMetadata, RateLimitInfo), APODClientError>
[src]
&'_ self,
date: &'_ Date,
hd: bool
) -> Result<(APODMetadata, RateLimitInfo), APODClientError>
Retrieve Metadata for AstronomyPicture
for the given date
RateLimitInfo
are returned as well
Auto Trait Implementations
impl Send for APODClient
impl Sync for APODClient
impl Unpin for APODClient
impl UnwindSafe for APODClient
impl RefUnwindSafe for APODClient
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,