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
impl AstroPositionRequest
Sourcepub fn new() -> AstroPositionRequest<RequiredArgument, RequiredArgument, RequiredArgument>
pub fn new() -> AstroPositionRequest<RequiredArgument, RequiredArgument, RequiredArgument>
Start building a new request.
Source§impl<A, B, C> AstroPositionRequest<A, B, C>
impl<A, B, C> AstroPositionRequest<A, B, C>
Sourcepub fn set_object(
self,
object: Vec<AstronomyObjectType>,
) -> AstroPositionRequest<ProvidedArgument, B, C>
pub fn set_object( self, object: Vec<AstronomyObjectType>, ) -> AstroPositionRequest<ProvidedArgument, B, C>
Set a list of objects for the request.
Sourcepub fn with_object(
self,
object: AstronomyObjectType,
) -> AstroPositionRequest<ProvidedArgument, B, C>
pub fn with_object( self, object: AstronomyObjectType, ) -> AstroPositionRequest<ProvidedArgument, B, C>
Add an object to the request.
Sourcepub fn set_placeid(
self,
placeid: Vec<impl Into<String>>,
) -> AstroPositionRequest<A, ProvidedArgument, C>
pub fn set_placeid( self, placeid: Vec<impl Into<String>>, ) -> AstroPositionRequest<A, ProvidedArgument, C>
Set a list of placeids for the request.
Sourcepub fn with_placeid(
self,
placeid: impl Into<String>,
) -> AstroPositionRequest<A, ProvidedArgument, C>
pub fn with_placeid( self, placeid: impl Into<String>, ) -> AstroPositionRequest<A, ProvidedArgument, C>
Add a placeid to the request.
Sourcepub fn set_interval(
self,
interval: Vec<DateTime>,
) -> AstroPositionRequest<A, B, ProvidedArgument>
pub fn set_interval( self, interval: Vec<DateTime>, ) -> AstroPositionRequest<A, B, ProvidedArgument>
Set a list of intervals for the request.
Sourcepub fn with_interval(
self,
interval: DateTime,
) -> AstroPositionRequest<A, B, ProvidedArgument>
pub fn with_interval( self, interval: DateTime, ) -> AstroPositionRequest<A, B, ProvidedArgument>
Add an interval to the request.
Sourcepub fn set_localtime(self, enable: bool) -> Self
pub fn set_localtime(self, enable: bool) -> Self
Toggle whether intervals should be considered local time or UTC time.
Sourcepub fn set_utctime(self, enable: bool) -> Self
pub fn set_utctime(self, enable: bool) -> Self
Toggle whether to add time stamps in UTC to all events.
Sourcepub fn set_isotime(self, enable: bool) -> Self
pub fn set_isotime(self, enable: bool) -> Self
Toggle whether to add time stamps in local time to all events.
Sourcepub fn set_lang(self, lang: impl Into<String>) -> Self
pub fn set_lang(self, lang: impl Into<String>) -> Self
Set the request language for the request.
Sourcepub fn set_radius(self, radius: i32) -> Self
pub fn set_radius(self, radius: i32) -> Self
Set search radius for translating coordinates to locations.
Trait Implementations§
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>
impl<A, B, C> Sync for AstroPositionRequest<A, B, C>
impl<A, B, C> Unpin for AstroPositionRequest<A, B, C>
impl<A, B, C> UnwindSafe for AstroPositionRequest<A, B, C>
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