pub struct Location {
pub latitude: f64,
pub longitude: f64,
pub elevation: f64,
pub timezone: Option<TimeZone>,
}Expand description
A geographic location (latitude/longitude/elevation) and an optional timezone.
Fields§
§latitude: f64Latitude in degrees. Valid range: [-90.0, 90.0] (positive = North).
longitude: f64Longitude in degrees. Valid range: [-180.0, 180.0] (positive = East).
Must be provided with a timezone when abs(longitude) > 150°.
elevation: f64Elevation above sea level in meters. Must be >= 0.0.
timezone: Option<TimeZone>Timezone of the location. Required when near the anti-meridian (abs(longitude) > 150°).
Also required for calculating kiddush levena times.
Implementations§
Source§impl Location
impl Location
Sourcepub fn new(
latitude: f64,
longitude: f64,
elevation: f64,
timezone: Option<TimeZone>,
) -> Result<Self, ZmanimError>
pub fn new( latitude: f64, longitude: f64, elevation: f64, timezone: Option<TimeZone>, ) -> Result<Self, ZmanimError>
Creates a new Location, returning a ZmanimError if any value is out of range.
§Errors
ZmanimError::InvalidLatitude—latitudeoutside[-90.0, 90.0]ZmanimError::InvalidLongitude—longitudeoutside[-180.0, 180.0]ZmanimError::InvalidElevation—elevationbelow0.0ZmanimError::TimeZoneRequired—timezoneisNoneandabs(longitude) > 150°
Trait Implementations§
impl StructuralPartialEq for Location
Auto Trait Implementations§
impl Freeze for Location
impl RefUnwindSafe for Location
impl Send for Location
impl Sync for Location
impl Unpin for Location
impl UnsafeUnpin for Location
impl UnwindSafe for Location
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, T> ConvertInto<T> for Fwhere
T: ConvertFrom<F>,
impl<F, T> ConvertInto<T> for Fwhere
T: ConvertFrom<F>,
Source§fn convert_into(self) -> T
fn convert_into(self) -> T
Infallibly converts a value of type
Self to a value of type T.Source§impl<F, T> ConvertTryFrom<F> for Twhere
F: ConvertInto<T>,
impl<F, T> ConvertTryFrom<F> for Twhere
F: ConvertInto<T>,
Source§type Error = Infallible
type Error = Infallible
The type of an error that can occur during a conversion. Read more
Source§fn convert_try_from(value: F) -> Result<T, Infallible>
fn convert_try_from(value: F) -> Result<T, Infallible>
Fallibly converts a value of type
F to a value of type Self.Source§impl<F, T> ConvertTryInto<T> for Fwhere
T: ConvertTryFrom<F>,
impl<F, T> ConvertTryInto<T> for Fwhere
T: ConvertTryFrom<F>,
Source§type Error = <T as ConvertTryFrom<F>>::Error
type Error = <T as ConvertTryFrom<F>>::Error
The type of an error that can occur during a conversion. Read more
Source§fn convert_try_into(self) -> Result<T, <T as ConvertTryFrom<F>>::Error>
fn convert_try_into(self) -> Result<T, <T as ConvertTryFrom<F>>::Error>
Fallibly converts a value of type
Self to a value of type T.