pub struct GooglePlacesAPI { /* private fields */ }
Implementations§
Source§impl GooglePlacesAPI
impl GooglePlacesAPI
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new instance of GooglePlacesAPI
.
Loads environment variables using dotenv
and retrieves the
GOOGLE_PLACES_API_KEY
from the environment to initialize the API key.
Initializes a new reqwest::Client
for HTTP requests.
§Panics
Panics if the GOOGLE_PLACES_API_KEY
environment variable is not set.
Sourcepub fn place_search(&self) -> PlaceSearch<'_>
pub fn place_search(&self) -> PlaceSearch<'_>
Returns a new PlaceSearch
instance with the API key and client.
Auto Trait Implementations§
impl Freeze for GooglePlacesAPI
impl !RefUnwindSafe for GooglePlacesAPI
impl Send for GooglePlacesAPI
impl Sync for GooglePlacesAPI
impl Unpin for GooglePlacesAPI
impl !UnwindSafe for GooglePlacesAPI
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