asterix_parser 0.1.1

Playground do Protocolo ASTERIX
Documentation
use thiserror::Error;

#[derive(Error, Debug)]
pub enum ParseError {
    #[error("category {category_code} not found")]
    CategoryNotFound { category_code: String },
    #[error("category {category_code} not found")]
    CategoryUapDefinitionNotFound { category_code: String },
    #[error("category {category_code}, edition {edition}, provider {provider} is not yet supported")]
    CategoryNotYetSupported { category_code: String, edition: String, provider: String },
    #[error("Message informed length [{informed}] doesn't match current length [{current}]")]
    BadMessageInformedLength { informed: usize, current: usize },
    #[error("UAP definition not found for {uap_name}")]
    UapDefinitionNotFound { uap_name: String },
    #[error("failed to parse the asterix date attribute")]
    ParseDateError,
    #[error("Parser unforeseen dependency relation")]
    ParserUnforeseenDependecyRelation,
    #[error("Could not open UAP JSON definition file")]
    OpenUapJsonDefinitionError,
    #[error("Error deserializing definition of attribute {attribute}, error:{error}")]
    DeserializationError{attribute: String, error: String},
    #[error("Invalid category CAT{category:03}")]
    InvalidCategory{category: u8},
    #[error("The provided messsage length [{provided_len}] does not comply with message stream length [{stream_len}]")]
    InvalidLength{provided_len: usize, stream_len: usize},
    #[error("The provided reptitive field length is invalid [{size}]")]
    InvalidRepetitiveFieldLength{size: usize},
    #[error("The provided element field length is invalid [{size}]")]
    InvalidElementFieldLength{size: usize},
    #[error("The provided data item [{dataitem}] could not return a valid length")]
    CouldNotRetrieveLength{dataitem: String},
}