[][src]Struct apod_async_client::APODClient

pub struct APODClient { /* fields omitted */ }

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]

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]

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]

Retrieve Metadata for AstronomyPicture for the given date

RateLimitInfo are returned as well

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]