ConvertTimeRequest

Struct ConvertTimeRequest 

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

Time API requests. ConvertTime API request.

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

Example:

use libtad_rs::{
    ServiceClient,
    service::time::ConvertTimeRequest,
    models::time::DateTime,
};

let client = ServiceClient::new("access_key".into(), "secret_key".into());
let request = ConvertTimeRequest::new()
    .set_fromid("norway/oslo")
    .set_datetime(DateTime::from("2021-04-05T16:45:02"))
    .set_verbosetime(true);

let response = client.convert_time(&request);

Implementations§

Source§

impl ConvertTimeRequest

Source

pub fn new() -> ConvertTimeRequest<RequiredArgument, RequiredArgument>

Start building a new request.

Source§

impl<A, B> ConvertTimeRequest<A, B>

Source

pub fn set_fromid( self, fromid: impl Into<String>, ) -> ConvertTimeRequest<ProvidedArgument, B>

Set location to convert from.

Source

pub fn with_toid(self, toid: impl Into<String>) -> Self

Add a location id to convert to.

Source

pub fn set_datetime( self, datetime: DateTime, ) -> ConvertTimeRequest<A, ProvidedArgument>

Set date and time to convert.

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_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, B: Default> Default for ConvertTimeRequest<A, B>

Source§

fn default() -> ConvertTimeRequest<A, B>

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

impl<A, B> Serialize for ConvertTimeRequest<A, B>

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, B> Freeze for ConvertTimeRequest<A, B>

§

impl<A, B> RefUnwindSafe for ConvertTimeRequest<A, B>

§

impl<A, B> Send for ConvertTimeRequest<A, B>
where A: Send, B: Send,

§

impl<A, B> Sync for ConvertTimeRequest<A, B>
where A: Sync, B: Sync,

§

impl<A, B> Unpin for ConvertTimeRequest<A, B>
where A: Unpin, B: Unpin,

§

impl<A, B> UnwindSafe for ConvertTimeRequest<A, B>
where A: UnwindSafe, B: 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,