asn1rs v0.2.1
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
Changes
- BREAKING:
Model::try_from(Tokenizer)
now returnsModel<Asn<Unresolved>>
. To convert to rust (Model::<Asn<Resolved>>::to_rust(&self) -> Model<Rust>
) the fallible functionModel::<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();