DSTListRequest

Struct DSTListRequest 

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

Time API requests. DSTList API request.

Example:

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

let client = ServiceClient::new("access_key".into(), "secret_key".into());
let request = DSTListRequest::new()
    .set_year(2021)
    .set_onlydst(true);

let response = client.get_daylight_savings_time(&request);

Implementations§

Source§

impl DSTListRequest

Source

pub fn new() -> Self

Start building a new request.

Source

pub fn set_year(self, year: i32) -> Self

Set year to query for.

Source

pub fn set_country(self, country: impl Into<String>) -> Self

Set country to query for.

Source

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

Set request language.

Source

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

Toggle whether to include individual places belonging to each country.

Source

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

Toggle whether to only include places which observe DST.

Source

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

Toggle whether to include time change information.

Source

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

Toggle whether to include verbose time stamps.

Trait Implementations§

Source§

impl Default for DSTListRequest

Source§

fn default() -> DSTListRequest

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

impl Serialize for DSTListRequest

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§

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,