TimeserviceRequest

Struct TimeserviceRequest 

Source
pub struct TimeserviceRequest<A = ProvidedArgument> { /* private fields */ }
Expand description

Time API requests. Timeservice API request.

Request is validated at compile time when supplied to the client.

Example:

use libtad_rs::{
    ServiceClient,
    service::time::TimeserviceRequest,
};

let client = ServiceClient::new("access_key".into(), "secret_key".into());
let request = TimeserviceRequest::new()
    .set_query("new york")
    .set_qlimit(2)
    .set_sun(true);

let response = client.get_current_time(&request);

Implementations§

Source§

impl TimeserviceRequest

Source

pub fn new() -> TimeserviceRequest<RequiredArgument>

Start building a new request.

Source§

impl<A> TimeserviceRequest<A>

Source

pub fn set_placeid( self, placeid: impl Into<String>, ) -> TimeserviceRequest<ProvidedArgument>

Set location id to get current time for.

Source

pub fn set_query( self, query: impl Into<String>, ) -> TimeserviceRequest<ProvidedArgument>

Set location query to get current time for.

Source

pub fn set_qlimit(self, qlimit: u8) -> Self

Set the limit for query results to be returned.

Source

pub fn set_geo(self, enable: bool) -> Self

Toggle whether to return longitude and latitude for the geo object.

Source

pub fn set_lang(self, lang: impl Into<String>) -> Self

Set the request language.

Source

pub fn set_radius(self, radius: i32) -> Self

Set search radius for translating coordinates to locations.

Source

pub fn set_sun(self, enable: bool) -> Self

Toggle whether to include information about sunrise and sunset.

Source

pub fn set_time(self, enable: bool) -> Self

Toggle whether to include current time under the location object.

Source

pub fn set_timechanges(self, enable: bool) -> Self

Toggle whether to include time change information.

Source

pub fn set_tz(self, enable: bool) -> Self

Toggle whether to include time zone information.

Source

pub fn set_verbosetime(self, enable: bool) -> Self

Toggle whether to include verbose time stamps.

Trait Implementations§

Source§

impl<A: Default> Default for TimeserviceRequest<A>

Source§

fn default() -> TimeserviceRequest<A>

Returns the “default value” for a type. Read more
Source§

impl<A> Serialize for TimeserviceRequest<A>

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<A> Freeze for TimeserviceRequest<A>

§

impl<A> RefUnwindSafe for TimeserviceRequest<A>
where A: RefUnwindSafe,

§

impl<A> Send for TimeserviceRequest<A>
where A: Send,

§

impl<A> Sync for TimeserviceRequest<A>
where A: Sync,

§

impl<A> Unpin for TimeserviceRequest<A>
where A: Unpin,

§

impl<A> UnwindSafe for TimeserviceRequest<A>
where A: UnwindSafe,

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,