[−][src]Struct sounding_base::StationInfo
Station information including location data and identification number.
Methods
impl StationInfo
[src]
impl StationInfo
pub fn new_with_values<T, U, V, W>( | [src] |
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>());
pub fn new() -> Self | [src] |
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());
pub fn with_station<T>(self, number: T) -> Self where | [src] |
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);
pub fn with_lat_lon<T>(self, coords: T) -> Self where | [src] |
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));
pub fn with_elevation<T, U>(self, elev: T) -> Self where | [src] |
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>());
pub fn station_num(&self) -> Optioned<i32> | [src] |
station number, USAF number, eg 727730
pub fn location(&self) -> Option<(f64, f64)> | [src] |
Latitude and longitude.
pub fn elevation(&self) -> Optioned<Meters> | [src] |
Elevation in meters, this may be in model terrain, not necessarily the same as the real world.
Trait Implementations
impl PartialEq<StationInfo> for StationInfo
[src]
impl PartialEq<StationInfo> for StationInfo
fn eq(&self, other: &StationInfo) -> bool | [src] |
fn ne(&self, other: &StationInfo) -> bool | [src] |
impl Clone for StationInfo
[src]
impl Clone for StationInfo
fn clone(&self) -> StationInfo | [src] |
fn clone_from(&mut self, source: &Self) | 1.0.0 [src] |
Performs copy-assignment from source
. Read more
impl Default for StationInfo
[src]
impl Default for StationInfo
fn default() -> StationInfo | [src] |
impl Copy for StationInfo
[src]
impl Copy for StationInfo
impl Debug for StationInfo
[src]
impl Debug for StationInfo
Auto Trait Implementations
impl Send for StationInfo
impl Send for StationInfo
impl Sync for StationInfo
impl Sync for StationInfo
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error> | [src] |
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId | [src] |
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error> | [src] |
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T | [src] |