pub struct Template5_50002 {
pub simple: SimplePacking,
pub first_order_values_width: u8,
pub num_groups: u32,
pub second_order_packed_values_width: u32,
pub widths_width: u8,
pub widths_len: u8,
pub ordering_flags: OrderingFlags,
pub spd_order: u8,
pub optional: Option<Template5_50002Optional>,
}Expand description
Data representation template 5.50002 - Second order packing.
This local template is defined by Météo-France.
§Examples
use std::io::Read;
use grib::{
TryFromSlice,
def::grib2::template::{Template5_50002, Template5_50002Optional, param_set},
};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let mut buf = Vec::new();
let f = std::fs::File::open("testdata/constant-polyn0025.grib2")?;
let mut f = std::io::BufReader::new(f);
f.read_to_end(&mut buf)?;
let mut pos = 0x9a;
let actual = Template5_50002::try_from_slice(&buf, &mut pos)?;
let expected = Template5_50002 {
simple: param_set::SimplePacking {
ref_val: -0.46913582,
exp: -13,
dec: 0,
num_bits: 24,
},
first_order_values_width: 23,
num_groups: 379,
second_order_packed_values_width: 264145,
widths_width: 5,
widths_len: 14,
ordering_flags: param_set::OrderingFlags(0b00000000),
spd_order: 2,
optional: Some(Template5_50002Optional {
num_spd_width_bits: 24,
}),
};
assert_eq!(actual, expected);
Ok(())
}Fields§
§simple: SimplePacking§first_order_values_width: u8Width of first order values.
num_groups: u32Number of groups.
second_order_packed_values_width: u32Number of second order packed values.
widths_width: u8Width of widths.
widths_len: u8Width of lengths.
ordering_flags: OrderingFlags§spd_order: u8Order of spatial differencing.
optional: Option<Template5_50002Optional>Trait Implementations§
Source§impl Clone for Template5_50002
impl Clone for Template5_50002
Source§fn clone(&self) -> Template5_50002
fn clone(&self) -> Template5_50002
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 Template5_50002
impl Debug for Template5_50002
Source§impl Dump for Template5_50002
impl Dump for Template5_50002
Source§impl PartialEq for Template5_50002
impl PartialEq for Template5_50002
impl StructuralPartialEq for Template5_50002
Source§impl TryFromSlice for Template5_50002
impl TryFromSlice for Template5_50002
Source§impl WriteToBuffer for Template5_50002
impl WriteToBuffer for Template5_50002
Auto Trait Implementations§
impl Freeze for Template5_50002
impl RefUnwindSafe for Template5_50002
impl Send for Template5_50002
impl Sync for Template5_50002
impl Unpin for Template5_50002
impl UnsafeUnpin for Template5_50002
impl UnwindSafe for Template5_50002
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