Skip to content

Releases: amazon-ion/ion-rust

v1.0.0 Release Candidate 1

19 Jul 21:59
42adf28
Compare
Choose a tag to compare

This release is the first release candidate for ion-rust v1.0. It stabilizes the Element API for reading, writing, and manipulating Ion data. Please open issues for any API concerns that cannot be addressed in a backwards-compatible manner. We still intend to offer features like serde support and stabilize streaming readers and writers in future releases.

Breaking changes from v0.18

Experimental features

Portions of the API that are not ready to be stabilized have been moved into opt-in crate features.

Warning
Types requiring the experimental- features are still subject to breaking changes between minor versions.

This includes:

  • The streaming reader (experimental-reader)
  • The streaming writer (experimental-writer)
  • Ion hash (experimental-ion-hash).

Most inner modules are now private

Nearly all inner modules are now private. In almost all cases, types that were previously imported from paths like ion_rs::types::, ion_rs::element::, etc have been re-exported at the top level.

// Before
use crate::element::Element;
use crate::result::IonResult;
use crate::types::Int;

// After
use crate::{Element, Int, IonResult};

Int and UInt are now opaque structs, not enums

In order to minimize the number of third-party types exposed in the public API, the Int and UInt types are now opaque structs. This prevents users from encountering version mismatches between their own dependency on num-bigint and ion_rs's dependency on num-bigint.

// Before
let int = Int::from(5);

match int {
  Int::I64(i64_value) => {...},
  Int::BigInt(big_int_value) => {...},
};

// After
let int = Int::from(5);

let value: i64 = int.try_into()?;
// or
let value: BigInt = int.into()?;

Into/TryInto have been added for Int/UInt to and from most Rust integer types, including i128/u128.

Vec<Element> has been replaced by Sequence

In order to make implementation changes in the future, APIs that previously returned Vec<Element> now return Sequence, an opaque wrapper around Vec<Element>.

IonError is now non_exhaustive

We may need to add new error variants to IonError in the future, so it is now marked non_exhaustive.

IonError's variants are now opaque structs

In order to improve error handling and enable future implementation changes, each of the error variants is now an opaque struct.

match Element::read_one(...) {
  Ok(element) => {...},
  Err(Decoding(e)) => {...},
  Err(Encoding(e)) => {...},
  Err(Io(e)) => {...},
  Err(IllegalOperation(e)) = {...}
  // ...
}

Methods referring to 3rd party types have been removed

The streaming reader and writer (both now marked experimental) previously supported chrono DateTimes and BigDecimals, which were holdovers from before we implemented Timestamp and Decimal.

The TimestampBuilder API is now simpler

See #588; most method names have remained the same, but the types they return have changed, potentially leading to breakage.

Pull Requests

Full Changelog: v0.18.1...v1.0.0-rc.1

v0.18.1

09 Jun 21:20
7bc5c74
Compare
Choose a tag to compare

What's Changed

  • Hotfix v0.18.1: Exposes raw bytes accessors in the SystemReader by @zslayton in #566

Full Changelog: v0.18.0...v0.18.1

v0.18.0

09 Jun 19:26
53ae38c
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.17.0...v0.18.0

v0.17.0

19 Apr 20:41
049da35
Compare
Choose a tag to compare

What's Changed

  • Make Element implement Send by @zslayton in #497
  • Implements IntoIterator for container Elements by @zslayton in #499
  • Custom string type by @zslayton in #501
  • Makes List and SExp thin wrappers around Sequence by @zslayton in #502
  • Makes Value::List and Value::SExp wrap Sequence by @zslayton in #505
  • Introduces Bytes, Blob, and Clob wrapper types by @zslayton in #506
  • Handle incomplete errors when parsing escaped string sequences by @nirosys in #495
  • Add BlockingRawReader as a blocking wrapper around non-blocking text and binary readers by @nirosys in #493
  • Introduces an Annotations type by @zslayton in #508
  • Remove map_ APIs and replace them with read_ by @nirosys in #509
  • Adds conversion from byte literals to Bytes by @popematt in #510
  • Adds Copy/Clone derivation to StreamItem by @almann in #513
  • Version bump to v0.17.0 by @zslayton in #514

Full Changelog: v0.16.0...v0.17.0

v0.16.0

18 Mar 02:38
ecdf439
Compare
Choose a tag to compare

What's Changed

  • Introduced builder APIs for List, SExp, and Struct
  • Introduced ion_list!, ion_sexp!, and ion_struct! macros for initializing container Elements.
  • Into<Element> implementations for Rust types that map intuitively to Ion types.
  • Modernized the ElementReader trait so all IonReader implementations can read the current value(s) as an Element.
  • Modernized the ElementWriter trait so all IonWriter implementations can write an Element.
  • Adds accessor methods for the various time unit fields in a Timestamp
  • ion-hash is now a feature of ion-rs instead of an independent crate, eliminating downstream dependency version mismatches
  • Removed the ion-c-sys crate
  • Removed the little-used value::borrowed module and the IonElement trait
  • Bugfixes for the text reader

PRs

Full Changelog: v0.15.0...v0.16.0

v0.15.0

29 Dec 23:14
96cd7ce
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.14.0...v0.15.0

v0.14.0

13 Oct 20:51
1ab131a
Compare
Choose a tag to compare
v0.14.0 Pre-release
Pre-release

Note: This release does not include a new version of ion-hash, which depends on ion-rust v0.13.0. A new version of ion-hash will be available with the next release of ion-rust. If you depend on ion-hash, please wait to upgrade.

What's Changed

New Contributors

Full Changelog: v0.13.0...v0.14.0

v0.13.0

02 Sep 16:41
3571e38
Compare
Choose a tag to compare
v0.13.0 Pre-release
Pre-release

What's Changed

  • adds changes for has_annotation method for Element API by @desaikd in #401
  • Encoding oversized binary decimals no longer fails quietly by @zslayton in #407
  • The IonValueFormatter now uses the correct s-exp delimiter by @zslayton in #408
  • Add a ToIonDataSource implementation for std::io::Cursor and references to byte arrays. by @jnicholls in #406
  • adds changes for Ord implementation of Timestamp by @desaikd in #410
  • bumps ion-rs version to v0.13.0 by @desaikd in #412

New Contributors

Full Changelog: v0.12.0...v0.13.0

v0.12.0

06 Jul 17:07
9ab9924
Compare
Choose a tag to compare
v0.12.0 Pre-release
Pre-release

What's Changed

  • adds text formatter and Display impl for OwnedElement by @desaikd in #391
  • adds PartialOrd and Ord implementations for Integer, UInteger and Timestamp by @desaikd in #393
  • Adds a non-blocking raw binary reader by @zslayton in #394
  • Optimizes reading binary symbol and integer values by @zslayton in #396
  • Updates ion-c to latest commit, fixes clippy warnings by @zslayton in #397
  • Bumps version for ion-rs, ion-c-sys, ion-hash by @zslayton in #398

Full Changelog: v0.11.0...v0.12.0

v0.11.0

29 May 00:22
57accbe
Compare
Choose a tag to compare
v0.11.0 Pre-release
Pre-release

Major changes:

  • ion-rust's readers and writers now pass the ion-tests spec conformance suite (minus tests that require shared symbol table imports).
  • ion-c-sys integration is now gated behind an optional feature called ion_c. Crates that don't need access to the ion-c readers and writers no longer have to build cmake, clang, ion-c-sys, ion-c-sys-macros, etc.
  • Readers and writers now have builder APIs instead of new() methods, allowing us to add more optional configuration settings over time.

What's Changed

  • Adds NativeElementWriter, string/clob validation, big DecodedInts by @zslayton in #384
  • Writer tests; fixes:symbols, timestamps, big Ints by @zslayton in #386
  • Implements IonEq for Timestamp, Decimal by @zslayton in #387
  • Reader/Writer builders, pretty text writer by @zslayton in #388
  • Makes ion-c-sys an opt-in feature by @zslayton in #389
  • Version bump: ion-rs v0.11.0, ion-hash v0.0.8 by @zslayton in #390

Full Changelog: v0.10.0...v0.11.0