BusinessDurationRequest

Struct BusinessDurationRequest 

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

Date Calculator API requests. Business Duration API request.

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

Example:

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

let client = ServiceClient::new("access_key".into(), "secret_key".into());
let request = BusinessDurationRequest::new()
    .set_country("dk")
    .set_startdt(DateTime::from("2021-08-12"))
    .set_enddt(DateTime::from("2021-08-20"));

let response = client.calculate_business_duration(&request);

Implementations§

Source§

impl BusinessDurationRequest

Source§

impl<A, B, C> BusinessDurationRequest<A, B, C>

Source

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

Set placeid to calculate for.

Source

pub fn set_country( self, country: impl Into<String>, ) -> BusinessDurationRequest<ProvidedArgument, B, C>

Set country to calculate for.

Source

pub fn set_state(self, state: impl Into<String>) -> Self

Set state for the given country.

Source

pub fn set_startdt( self, startdt: DateTime, ) -> BusinessDurationRequest<A, ProvidedArgument, C>

Set start date for the request.

Source

pub fn set_enddt( self, enddt: DateTime, ) -> BusinessDurationRequest<A, B, ProvidedArgument>

Set end date for the request.

Source

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

Toggle whether the result should be calculated by including instead of excluding days.

Source

pub fn with_filter(self, filter: BusinessDaysFilterType) -> Self

Add a filter to the request.

Source

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

Set whether or not the last date should be counted in the result.

Source

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

Set request language.

Source

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

Toggle whether to include verbose time stamps.

Trait Implementations§

Source§

impl<A: Default, B: Default, C: Default> Default for BusinessDurationRequest<A, B, C>

Source§

fn default() -> BusinessDurationRequest<A, B, C>

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

impl<A, B, C> Serialize for BusinessDurationRequest<A, B, C>

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

§

impl<A, B, C> RefUnwindSafe for BusinessDurationRequest<A, B, C>

§

impl<A, B, C> Send for BusinessDurationRequest<A, B, C>
where A: Send, B: Send, C: Send,

§

impl<A, B, C> Sync for BusinessDurationRequest<A, B, C>
where A: Sync, B: Sync, C: Sync,

§

impl<A, B, C> Unpin for BusinessDurationRequest<A, B, C>
where A: Unpin, B: Unpin, C: Unpin,

§

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