Skip to content

asn1rs v0.2.1

Compare
Choose a tag to compare
@kellerkindt kellerkindt released this 22 Mar 14:22
· 157 commits to master since this release

Version 0.2.1 (2021-03-22)

This release refactors Model<Asn> which is now represented as Model<Asn<Unresolved>> and Model<Asn<Resolved>>.
This change allows Value-References in SIZE and RANGE constraints (see gh-50 gh-49) without a failable to_rust() converter.

Fixes

  • No longer choke on empty SEQUENCE definitions (see gh-44)

Added

  • Parsing and resolving Value-References in SIZE and RANGE constraints (see gh-50 gh-49)

Changes

  • BREAKING: Model::try_from(Tokenizer) now returns Model<Asn<Unresolved>>. To convert to rust (Model::<Asn<Resolved>>::to_rust(&self) -> Model<Rust>) the fallible function Model::<Asn<Unresolved>>::try_resolve(&self) -> Model<Asn<Resolved>> must be called first.
let model_rust = Model::try_from(asn_tokens)
    .expect("Failed to parse tokens")
    .try_resolve() //                                 <--------------+--- new
    .expect("Failed to resolve at least one value reference") // <---+
    .to_rust();