pub struct Ads { /* private fields */ }
Expand description
An interface to the NASA ADS API.
This has various configuration values to tweak, but the most important one
is token
, which you’ll want to set to your ADS API token, which is
available on your ADS settings page. To configure your Ads
interface,
use Ads::builder
.
§Examples
use adsabs::Ads;
let api_token = "ADS_API_TOKEN";
let client = Ads::new(api_token)?;
Implementations§
Source§impl Ads
impl Ads
Sourcepub fn from_env() -> Result<Self>
pub fn from_env() -> Result<Self>
Constructs a new Ads
interface, loading the API token from either
environment valiables or the user’s home directory.
§Errors
This method fails when either AdsBuilder::build
or
AdsBuilder::from_env
fails.
Sourcepub fn builder(token: &str) -> AdsBuilder
pub fn builder(token: &str) -> AdsBuilder
Constructs a new AdsBuilder
so that the parameters of the Ads
interface can be customized.
Sourcepub fn search(&self, query: &str) -> Query<'_>
pub fn search(&self, query: &str) -> Query<'_>
Constructs a query for Search API endpoint that can be customized using
a search::Query
.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Ads
impl !RefUnwindSafe for Ads
impl !Send for Ads
impl !Sync for Ads
impl Unpin for Ads
impl !UnwindSafe for Ads
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more