-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Section3 builder * Dependency on derive_builder * Split Error in a module * Moving Section1 to a module by itself * Temporary fix * Test everything * Cleanning Don't need it in the core library but only in the module. * Some general info, but still incomplete * Patch upgrade Skeleton for a builder.
- Loading branch information
Showing
7 changed files
with
467 additions
and
350 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,7 @@ | ||
[workspace] | ||
members = [ "bufr-lib", "bufr-dump"] | ||
|
||
[workspace.package] | ||
version = "0.1.3" | ||
|
||
default-members = [ "bufr-lib" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
//#![deny(missing_docs)] | ||
|
||
/// Possible errors when parsing BUFR messages | ||
#[derive(Debug, thiserror::Error)] | ||
pub enum Error { | ||
/// Message too short to even contain the total size | ||
#[error("BUFR message is too short, less than 8 bytes")] | ||
MessageTooShort, | ||
|
||
/// Wrong magic number | ||
#[error("BUFR message should start with BUFR")] | ||
MagicNumber, | ||
|
||
/// Wrong end section | ||
#[error("BUFR message should end with 7777")] | ||
EndSection, | ||
|
||
/// Message shorter than specified on section 0 | ||
#[error("Message shorter than expected, is it truncated?")] | ||
TruncatedMessage, | ||
|
||
/// BUFR version not supported | ||
#[error("BUFR version {0} not supported")] | ||
VersionNotSupported(u8), | ||
|
||
/* | ||
/// Number of descriptors doesn't match the size | ||
#[error("Expected {n_descriptors} descriptors, requiring {descriptor_size}B but buffer size {buffer_size}B")] | ||
WrongNumberOfDescriptors { | ||
n_descriptors: u16, | ||
descriptor_size: usize, | ||
buffer_size: usize, | ||
}, | ||
*/ | ||
#[error("Section 3 must be larger than 7 and an odd number, got {0}")] | ||
InvalidSection3Length(usize), | ||
|
||
#[error(transparent)] | ||
IOError(#[from] std::io::Error), | ||
} |
Oops, something went wrong.