AstroPositionRequest

Struct AstroPositionRequest 

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

Astronomy API requests. Astro Position API request.

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

Example:

use libtad_rs::{
    ServiceClient,
    service::astronomy::AstroPositionRequest,
    models::{
        astronomy::AstronomyObjectType,
        time::DateTime,
    },
};

let client = ServiceClient::new("access_key".into(), "secret_key".into());
let request = AstroPositionRequest::new()
    .with_object(AstronomyObjectType::Sun)
    .with_placeid("3")
    .with_interval(DateTime::from("2021-08-18"));

let response = client.get_astro_position(&request);

Implementations§

Source§

impl AstroPositionRequest

Source§

impl<A, B, C> AstroPositionRequest<A, B, C>

Source

pub fn set_object( self, object: Vec<AstronomyObjectType>, ) -> AstroPositionRequest<ProvidedArgument, B, C>

Set a list of objects for the request.

Source

pub fn with_object( self, object: AstronomyObjectType, ) -> AstroPositionRequest<ProvidedArgument, B, C>

Add an object to the request.

Source

pub fn set_placeid( self, placeid: Vec<impl Into<String>>, ) -> AstroPositionRequest<A, ProvidedArgument, C>

Set a list of placeids for the request.

Source

pub fn with_placeid( self, placeid: impl Into<String>, ) -> AstroPositionRequest<A, ProvidedArgument, C>

Add a placeid to the request.

Source

pub fn set_interval( self, interval: Vec<DateTime>, ) -> AstroPositionRequest<A, B, ProvidedArgument>

Set a list of intervals for the request.

Source

pub fn with_interval( self, interval: DateTime, ) -> AstroPositionRequest<A, B, ProvidedArgument>

Add an interval to the request.

Source

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

Toggle whether intervals should be considered local time or UTC time.

Source

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

Toggle whether to add time stamps in UTC to all events.

Source

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

Toggle whether to add time stamps in local time to all events.

Source

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

Set the request language for the request.

Source

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

Set search radius for translating coordinates to locations.

Trait Implementations§

Source§

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

Source§

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

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

impl<A, B, C> Serialize for AstroPositionRequest<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 AstroPositionRequest<A, B, C>

§

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

§

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

§

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

§

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

§

impl<A, B, C> UnwindSafe for AstroPositionRequest<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,