gistools/readers/grib2/sections/_8/
mod.rs

1use crate::parsers::Reader;
2use alloc::string::String;
3
4/// # SECTION 8 - END SECTION
5///
6/// ## Links
7/// - [Docs](https://www.nco.ncep.noaa.gov/pmb/docs/grib2/grib2_doc/grib2_sect8.shtml)
8#[derive(Debug, Clone, PartialEq, Eq)]
9pub struct Grib2EndSection {
10    /// "7777" - Coded according to the International Alphabet Number 5
11    pub end_encoded: String,
12}
13impl Grib2EndSection {
14    /// Create a new Grib2EndSection
15    ///
16    /// ## Parameters
17    /// - `section`: byte block for section 8
18    ///
19    /// ## Returns
20    /// Parsed end section
21    pub fn new<T: Reader>(section: &T) -> Grib2EndSection {
22        Grib2EndSection { end_encoded: section.parse_string(Some(0), Some(4)) }
23    }
24}