Skip to main content

Message

Struct Message 

Source
pub struct Message<'a> { /* private fields */ }
Expand description

A single logical GRIB field.

Implementations§

Source§

impl<'a> Message<'a>

Source

pub fn edition(&self) -> u8

Source

pub fn index(&self) -> usize

Source

pub fn metadata(&self) -> &MessageMetadata

Source

pub fn reference_time(&self) -> &ReferenceTime

Source

pub fn parameter(&self) -> &Parameter

Source

pub fn center_id(&self) -> u16

Source

pub fn subcenter_id(&self) -> u16

Source

pub fn identification(&self) -> Option<&Identification>

Source

pub fn product_definition(&self) -> Option<&ProductDefinition>

Source

pub fn grib1_product_definition(&self) -> Option<&ProductDefinition>

Source

pub fn local_use_section(&self) -> Option<&'a [u8]>

Returns the complete encoded GRIB2 Section 2, including its five-byte length and section-number header, when present for this field.

Source

pub fn grid_definition(&self) -> &GridDefinition

Source

pub fn parameter_name(&self) -> &str

Source

pub fn parameter_description(&self) -> &str

Source

pub fn forecast_time_unit(&self) -> Option<u8>

Source

pub fn forecast_time_unit_kind(&self) -> Option<ForecastTimeUnit>

Source

pub fn forecast_time(&self) -> Option<i64>

Forecast offset in the units returned by Message::forecast_time_unit.

GRIB2 offsets are signed; GRIB1 offsets are widened to the same type.

Source

pub fn valid_time(&self) -> Option<ReferenceTime>

Source

pub fn grid_shape(&self) -> (usize, usize)

Source

pub fn latitudes(&self) -> Result<Option<Vec<f64>>>

Source

pub fn longitudes(&self) -> Result<Option<Vec<f64>>>

Source

pub fn rotated_latitudes(&self) -> Result<Option<Vec<f64>>>

Latitude axis in the rotated coordinate system for Template 3.1.

Source

pub fn rotated_longitudes(&self) -> Result<Option<Vec<f64>>>

Longitude axis in the rotated coordinate system for Template 3.1.

Source

pub fn projected_x_coordinates(&self) -> Result<Option<Vec<f64>>>

Source

pub fn projected_y_coordinates(&self) -> Result<Option<Vec<f64>>>

Source

pub fn decode_into<T: DecodeSample>(&self, out: &mut [T]) -> Result<()>

Decodes into row-major reader order.

Alternating scan rows are normalized, but the GRIB i/j scan directions are preserved. Use Message::decode_into_north_up when deterministic +i columns and -j rows are required. Bitmap omissions and embedded complex-packing missing codes are written as NaN; substitute metadata is not applied automatically.

Source

pub fn decode_into_north_up<T: DecodeSample>(&self, out: &mut [T]) -> Result<()>

Decodes into deterministic row-major orientation: +i columns and -j rows (north-to-south for conventional geographic grids).

Bitmap omissions and embedded complex-packing missing codes are written as NaN; substitute metadata is not applied automatically.

Source

pub fn read_flat_data_as_f64(&self) -> Result<Vec<f64>>

Returns a flat f64 field in row-major reader order.

Alternating rows are normalized, while encoded i/j directions are preserved. Use Message::read_flat_data_north_up_as_f64 for +i columns and -j rows.

Source

pub fn read_flat_data_as_f32(&self) -> Result<Vec<f32>>

Returns a flat f32 field in row-major reader order.

Alternating rows are normalized, while encoded i/j directions are preserved. Use Message::read_flat_data_north_up_as_f32 for +i columns and -j rows.

Source

pub fn read_flat_data_north_up_as_f64(&self) -> Result<Vec<f64>>

Returns a flat f64 field with +i columns and -j rows.

Source

pub fn read_flat_data_north_up_as_f32(&self) -> Result<Vec<f32>>

Returns a flat f32 field with +i columns and -j rows.

Source

pub fn read_data_as_f64(&self) -> Result<ArrayD<f64>>

Returns an f64 ndarray in row-major reader order.

Alternating rows are normalized, while encoded i/j directions are preserved. Use Message::read_data_north_up_as_f64 for deterministic +i columns and -j rows.

Source

pub fn read_data_as_f32(&self) -> Result<ArrayD<f32>>

Returns an f32 ndarray in row-major reader order.

Alternating rows are normalized, while encoded i/j directions are preserved. Use Message::read_data_north_up_as_f32 for deterministic +i columns and -j rows.

Source

pub fn read_data_north_up_as_f64(&self) -> Result<ArrayD<f64>>

Returns an f64 ndarray with +i columns and -j rows.

Source

pub fn read_data_north_up_as_f32(&self) -> Result<ArrayD<f32>>

Returns an f32 ndarray with +i columns and -j rows.

Source

pub fn raw_bytes(&self) -> &[u8] ⓘ

Auto Trait Implementations§

§

impl<'a> Freeze for Message<'a>

§

impl<'a> RefUnwindSafe for Message<'a>

§

impl<'a> Send for Message<'a>

§

impl<'a> Sync for Message<'a>

§

impl<'a> Unpin for Message<'a>

§

impl<'a> UnsafeUnpin for Message<'a>

§

impl<'a> UnwindSafe for Message<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.