pub struct StationInfo { /* private fields */ }
Expand description

Station information including location data and identification number.

Implementations

Create a new StationInfo object.

Arguments

station_num: The USAF station identifier, or None.

location: The latitude and longitude as a tuple, or None.

elevation: The elevation of the station in meters.

Examples
use metfor::{Meters, Feet};
use sounding_base::StationInfo;
use optional::{some, none};

let _stn = StationInfo::new_with_values(12345, (45.2,-113.5), Meters(2000.0));
let _stn = StationInfo::new_with_values(12345, (45.2,-113.5), Feet(2000.0));
let _stn = StationInfo::new_with_values(12345, (45.2,-113.5), some(Meters(2000.0)));
let _stn = StationInfo::new_with_values(12345, (45.2,-113.5), some(Feet(2000.0)));
let _stn = StationInfo::new_with_values(12345, Some((45.2,-113.5)), Meters(2000.0));
let _stn = StationInfo::new_with_values(12345, Some((45.2,-113.5)), Feet(2000.0));
let _stn = StationInfo::new_with_values(12345, Some((45.2,-113.5)), some(Meters(2000.0)));
let _stn = StationInfo::new_with_values(12345, Some((45.2,-113.5)), some(Feet(2000.0)));
let _stn = StationInfo::new_with_values(Some(12345), None, Meters(2000.0));
let _stn = StationInfo::new_with_values(Some(12345), None, Feet(2000.0));
let _stn = StationInfo::new_with_values(None, (45.2,-113.5), some(Meters(2000.0)));
let _stn = StationInfo::new_with_values(None, (45.2,-113.5), some(Feet(2000.0)));

// Note that lat-lon is an `Option` and not an `Optioned`
let _stn = StationInfo::new_with_values(some(12345), None, none::<Feet>());
let _stn = StationInfo::new_with_values(some(12345), None, none::<Meters>());

Create a new object with default values.

Examples
use sounding_base::StationInfo;

assert!(StationInfo::new().station_num().is_none());
assert!(StationInfo::new().location().is_none());
assert!(StationInfo::new().elevation().is_none());

Builder method to add a station number.

Examples
use sounding_base::StationInfo;

assert_eq!(StationInfo::new().with_station(12345).station_num().unwrap(), 12345);
assert_eq!(StationInfo::new().with_station(Some(12345)).station_num().unwrap(), 12345);

Builder method to add a location.

Examples
use sounding_base::StationInfo;

assert_eq!(
    StationInfo::new().with_lat_lon((45.0, -116.0)).location().unwrap(), (45.0, -116.0));
assert_eq!(
    StationInfo::new().with_lat_lon(Some((45.0, -116.0)))
        .location()
        .unwrap(),
    (45.0, -116.0));

Builder method to add elevation.

Examples
 use metfor::{Meters, Feet, Km};
 use sounding_base::StationInfo;
 use optional::{some, none};

 let _info = StationInfo::new().with_elevation(Feet(200.0));
 let _info = StationInfo::new().with_elevation(Meters(200.0));
 let _info = StationInfo::new().with_elevation(Km(2.0));
 let _info = StationInfo::new().with_elevation(some(Feet(200.0)));
 let _info = StationInfo::new().with_elevation(some(Meters(200.0)));
 let _info = StationInfo::new().with_elevation(some(Km(2.0)));
 let _info = StationInfo::new().with_elevation(none::<Feet>());
 let _info = StationInfo::new().with_elevation(none::<Meters>());
 let _info = StationInfo::new().with_elevation(none::<Km>());

station number, USAF number, eg 727730

Latitude and longitude.

Elevation in meters, this may be in model terrain, not necessarily the same as the real world.

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. 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.