#[non_exhaustive]pub enum GridDefinition {
LatLon(LatLonGrid),
LambertConformal(LambertConformalGrid),
Unsupported(u16),
}Expand description
Grid definition extracted from Section 3.
This enum is non-exhaustive because GRIB grid templates are open-ended: WMO can add standard templates and centers can use local templates. Prefer the query helpers on this type for common behavior, or keep a wildcard arm when matching specific grid families.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
LatLon(LatLonGrid)
Template 3.0: Regular latitude/longitude (equidistant cylindrical).
LambertConformal(LambertConformalGrid)
Template 3.30: Lambert conformal.
Unsupported(u16)
Unsupported template (stored for diagnostics).
Implementations§
Source§impl GridDefinition
impl GridDefinition
Sourcepub fn template_number(&self) -> u16
pub fn template_number(&self) -> u16
GRIB2 grid definition template number for typed templates.
Unsupported stores the unhandled template number from the source
message for diagnostics.
pub fn as_lat_lon(&self) -> Option<&LatLonGrid>
pub fn as_lambert_conformal(&self) -> Option<&LambertConformalGrid>
pub fn unsupported_template(&self) -> Option<u16>
pub fn shape(&self) -> (usize, usize)
pub fn ndarray_shape(&self) -> Vec<usize>
pub fn num_points(&self) -> usize
pub fn validate_supported_scan_order(&self) -> Result<(), Error>
pub fn reorder_for_ndarray_in_place<T>( &self, values: &mut [T], ) -> Result<(), Error>
pub fn parse(section_bytes: &[u8]) -> Result<GridDefinition, Error>
Trait Implementations§
Source§impl Clone for GridDefinition
impl Clone for GridDefinition
Source§fn clone(&self) -> GridDefinition
fn clone(&self) -> GridDefinition
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 GridDefinition
impl Debug for GridDefinition
Source§impl PartialEq for GridDefinition
impl PartialEq for GridDefinition
Source§fn eq(&self, other: &GridDefinition) -> bool
fn eq(&self, other: &GridDefinition) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for GridDefinition
Auto Trait Implementations§
impl Freeze for GridDefinition
impl RefUnwindSafe for GridDefinition
impl Send for GridDefinition
impl Sync for GridDefinition
impl Unpin for GridDefinition
impl UnsafeUnpin for GridDefinition
impl UnwindSafe for GridDefinition
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more