ServiceClient

Struct ServiceClient 

Source
pub struct ServiceClient { /* private fields */ }
Expand description

Client for accessing the Time and Date APIs.

Implementations§

Source§

impl ServiceClient

Source

pub fn get_astro_events( &self, request: &AstroEventRequest, ) -> Result<Result<AstronomyResponse, ApiError>, Error>

The Astro Event service can be used to retrieve the sunrise, sunset, moonrise, moonset, solar noon and twilight times for all locations in our database. The service can also return the azimuth of events, the altitude, and the distance to the sun for the noon event.

Source

pub fn get_astro_position( &self, request: &AstroPositionRequest, ) -> Result<Result<AstronomyResponse, ApiError>, Error>

The Astro Position service can be used to retrieve the altitude, azimuth and distance to the Moon and the Sun for all locations in our database. The service also returns the moon phase, the fraction of the Moon’s illuminated side as well as the midpoint angle of the Moon’s bright limb at any point in time.

Unlike the Astro Event service, the Astro Position service can be queried on a specific point in time, down to the second.

Source§

impl ServiceClient

Source

pub fn calculate_business_date( &self, request: &BusinessDateRequest, ) -> Result<Result<BusinessDateResponse, ApiError>, Error>

The BusinessDate service can be used to find a business date from a specified number of days.

Source

pub fn calculate_business_duration( &self, request: &BusinessDurationRequest, ) -> Result<Result<BusinessDurationResponse, ApiError>, Error>

The BusinessDuration service can be used to calculate the number of business days between a specified start date and end date.

Source§

impl ServiceClient

Source

pub fn get_holidays( &self, request: &HolidaysRequest, ) -> Result<Result<HolidaysResponse, ApiError>, Error>

The Holidays service can be used to retrieve a list of holidays for a country.

Source§

impl ServiceClient

Source

pub fn get_events_on_this_day( &self, request: &OnThisDayRequest, ) -> Result<Result<OnThisDayResponse, ApiError>, Error>

The On This Day service can be used to retrieve a list of events, births and deaths for a given day.

Source§

impl ServiceClient

Source

pub fn get_places( &self, request: &PlacesRequest, ) -> Result<Result<PlacesResponse, ApiError>, Error>

The Places service can be used to retrieve a list of supported places.

Source§

impl ServiceClient

Source

pub fn get_tidal_data( &self, request: &TidesRequest, ) -> Result<Result<TidesResponse, ApiError>, Error>

The Tides service can be used to retrieve predicted tidal data over a given time interval for a specific place.

Source§

impl ServiceClient

Source

pub fn convert_time( &self, request: &ConvertTimeRequest, ) -> Result<Result<ConvertTimeResponse, ApiError>, Error>

The ConvertTime service can be used to convert any time from UTC or any of the supported locations to any other of the supported locations.

Source

pub fn get_daylight_savings_time( &self, request: &DSTListRequest, ) -> Result<Result<DSTListResponse, ApiError>, Error>

The DSTList service can be used to obtain data about time zones for all supported countries in our database. This includes the start and end date of daylight savings time, and UTC offset for the time zones.

Source

pub fn get_current_time( &self, request: &TimeserviceRequest, ) -> Result<Result<TimeserviceResponse, ApiError>, Error>

The Timeservice service can be used to retrieve the current time in one or more places. Additionally, information about time zones and related changes and the time of sunrise and sunset can be queried.

Source§

impl ServiceClient

Source

pub fn new(access_key: String, secret_key: String) -> Self

Initialize a new client with an access and secret key.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,