pub struct StationInfo { /* private fields */ }
๐Deprecated
Expand description
Station information including location data and identification number.
Implementationsยง
Sourceยงimpl StationInfo
impl StationInfo
Sourcepub fn new_with_values<T, U, V, W>(
station_num: T,
location: U,
elevation: V,
) -> Self
๐Deprecated
pub fn new_with_values<T, U, V, W>( station_num: T, location: U, elevation: V, ) -> Self
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>());
Sourcepub fn new() -> Self
๐Deprecated
pub fn new() -> Self
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());
Sourcepub fn with_station<T>(self, number: T) -> Self
๐Deprecated
pub fn with_station<T>(self, number: T) -> Self
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);
Sourcepub fn with_lat_lon<T>(self, coords: T) -> Self
๐Deprecated
pub fn with_lat_lon<T>(self, coords: T) -> Self
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));
Sourcepub fn with_elevation<T, U>(self, elev: T) -> Self
๐Deprecated
pub fn with_elevation<T, U>(self, elev: T) -> Self
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>());
Sourcepub fn station_num(&self) -> Optioned<i32>
๐Deprecated
pub fn station_num(&self) -> Optioned<i32>
station number, USAF number, eg 727730
Trait Implementationsยง
Sourceยงimpl Clone for StationInfo
impl Clone for StationInfo
Sourceยงfn clone(&self) -> StationInfo
fn clone(&self) -> StationInfo
Returns a duplicate of the value. Read more
1.0.0 ยท Sourceยงfn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSourceยงimpl Debug for StationInfo
impl Debug for StationInfo
Sourceยงimpl Default for StationInfo
impl Default for StationInfo
Sourceยงfn default() -> StationInfo
fn default() -> StationInfo
Returns the โdefault valueโ for a type. Read more
Sourceยงimpl PartialEq for StationInfo
impl PartialEq for StationInfo
impl Copy for StationInfo
impl StructuralPartialEq for StationInfo
Auto Trait Implementationsยง
impl Freeze for StationInfo
impl RefUnwindSafe for StationInfo
impl Send for StationInfo
impl Sync for StationInfo
impl Unpin for StationInfo
impl UnwindSafe for StationInfo
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