pub struct CodesNearest<'a, P: Debug> { /* private fields */ }Expand description
The structure used to find nearest gridpoints in CodesMessage.
Implementations§
Source§impl<P: Debug> CodesNearest<'_, P>
impl<P: Debug> CodesNearest<'_, P>
Sourcepub fn find_nearest(
&mut self,
lat: f64,
lon: f64,
) -> Result<[NearestGridpoint; 4], CodesError>
pub fn find_nearest( &mut self, lat: f64, lon: f64, ) -> Result<[NearestGridpoint; 4], CodesError>
Function to get four NearestGridpoints of a point represented by requested coordinates.
The inputs are latitude and longitude of requested point in respectively degrees north and degreed east.
§Example
let mut handle = CodesFile::new_from_file("./data/iceland.grib", ProductKind::GRIB)?;
let msg = handle.ref_message_iter().next()?.context("no message")?;
let mut c_nearest = msg.codes_nearest()?;
let out = c_nearest.find_nearest(64.13, -21.89)?;§Errors
This function returns CodesInternal when
one of ecCodes function returns the non-zero code.
Trait Implementations§
Auto Trait Implementations§
impl<'a, P> Freeze for CodesNearest<'a, P>
impl<'a, P> RefUnwindSafe for CodesNearest<'a, P>where
P: RefUnwindSafe,
impl<'a, P> !Send for CodesNearest<'a, P>
impl<'a, P> !Sync for CodesNearest<'a, P>
impl<'a, P> Unpin for CodesNearest<'a, P>
impl<'a, P> UnwindSafe for CodesNearest<'a, P>where
P: RefUnwindSafe,
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