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
impl TimeserviceRequest
Sourcepub fn new() -> TimeserviceRequest<RequiredArgument>
pub fn new() -> TimeserviceRequest<RequiredArgument>
Start building a new request.
Source§impl<A> TimeserviceRequest<A>
impl<A> TimeserviceRequest<A>
Sourcepub fn set_placeid(
self,
placeid: impl Into<String>,
) -> TimeserviceRequest<ProvidedArgument>
pub fn set_placeid( self, placeid: impl Into<String>, ) -> TimeserviceRequest<ProvidedArgument>
Set location id to get current time for.
Sourcepub fn set_query(
self,
query: impl Into<String>,
) -> TimeserviceRequest<ProvidedArgument>
pub fn set_query( self, query: impl Into<String>, ) -> TimeserviceRequest<ProvidedArgument>
Set location query to get current time for.
Sourcepub fn set_qlimit(self, qlimit: u8) -> Self
pub fn set_qlimit(self, qlimit: u8) -> Self
Set the limit for query results to be returned.
Sourcepub fn set_geo(self, enable: bool) -> Self
pub fn set_geo(self, enable: bool) -> Self
Toggle whether to return longitude and latitude for the geo object.
Sourcepub fn set_radius(self, radius: i32) -> Self
pub fn set_radius(self, radius: i32) -> Self
Set search radius for translating coordinates to locations.
Sourcepub fn set_sun(self, enable: bool) -> Self
pub fn set_sun(self, enable: bool) -> Self
Toggle whether to include information about sunrise and sunset.
Sourcepub fn set_time(self, enable: bool) -> Self
pub fn set_time(self, enable: bool) -> Self
Toggle whether to include current time under the location object.
Sourcepub fn set_timechanges(self, enable: bool) -> Self
pub fn set_timechanges(self, enable: bool) -> Self
Toggle whether to include time change information.
Sourcepub fn set_verbosetime(self, enable: bool) -> Self
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>
impl<A: Default> Default for TimeserviceRequest<A>
Source§fn default() -> TimeserviceRequest<A>
fn default() -> TimeserviceRequest<A>
Returns the “default value” for a type. 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> 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