Struct solnedgang::Coordinates[][src]

pub struct Coordinates { /* fields omitted */ }
Expand description

Representation of a location on earth.

Implementations

Create a new Location instance from a pair of latitude and longitude in decimal representation.

Examples

To create a new instance of this class and print the coordinates to the console:

use solnedgang::Coordinates;

let duesseldorf = Coordinates::new(51.21794, 6.76165);
println!("GPS coordinates for Düsseldorf, Germany are: {}", duesseldorf);

Trait Implementations

Formats the value using the given formatter. Read more

Create a new instance of the SunriseSunsetCalculator class based on the location supplied.

Examples

Create the calculator for Düsseldorf, Germany:

use solnedgang::{SunriseSunsetCalculator, Coordinates};

let duesseldorf = Coordinates::new(51.21794, 6.76165);
let calculator = SunriseSunsetCalculator::from(duesseldorf);

Create a new instance of the Coordinates class based on a Location.

Examples

Create the coordinates for Berlin, Germany:

use solnedgang::{Coordinates, Location};

let berlin = Coordinates::from(Location::EuropeGermanyBerlin);

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.