pub struct ObserverLocation {
pub latitude: Latitude,
pub longitude: Longitude,
pub elevation_m: Option<f64>,
}Expand description
A geographic observer location.
Fields§
§latitude: LatitudeGeographic latitude, north of the equator positive (degrees).
longitude: LongitudeGeographic longitude, expressed in degrees east of Greenwich.
elevation_m: Option<f64>Optional elevation above sea level in meters.
Implementations§
Source§impl ObserverLocation
impl ObserverLocation
Sourcepub const fn new(
latitude: Latitude,
longitude: Longitude,
elevation_m: Option<f64>,
) -> Self
pub const fn new( latitude: Latitude, longitude: Longitude, elevation_m: Option<f64>, ) -> Self
Creates a new observer location.
Sourcepub fn validate(&self) -> Result<(), ObserverLocationValidationError>
pub fn validate(&self) -> Result<(), ObserverLocationValidationError>
Validates that the stored observer location is finite and within the latitude range expected by house calculations.
Sourcepub fn summary_line(&self) -> String
pub fn summary_line(&self) -> String
Returns a compact one-line rendering of the observer location.
Sourcepub fn validated_summary_line(
&self,
) -> Result<String, ObserverLocationValidationError>
pub fn validated_summary_line( &self, ) -> Result<String, ObserverLocationValidationError>
Returns a compact one-line rendering after validating the stored data.
Trait Implementations§
Source§impl Clone for ObserverLocation
impl Clone for ObserverLocation
Source§impl Debug for ObserverLocation
impl Debug for ObserverLocation
Source§impl<'de> Deserialize<'de> for ObserverLocation
impl<'de> Deserialize<'de> for ObserverLocation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ObserverLocation
impl Display for ObserverLocation
Source§impl PartialEq for ObserverLocation
impl PartialEq for ObserverLocation
Source§impl Serialize for ObserverLocation
impl Serialize for ObserverLocation
impl StructuralPartialEq for ObserverLocation
Auto Trait Implementations§
impl Freeze for ObserverLocation
impl RefUnwindSafe for ObserverLocation
impl Send for ObserverLocation
impl Sync for ObserverLocation
impl Unpin for ObserverLocation
impl UnsafeUnpin for ObserverLocation
impl UnwindSafe for ObserverLocation
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