Download Latest Version trustfall-v0.8.0 source code.tar.gz (1.4 MB)
Email in envelope

Get an email when there's a new version of trustfall

Home / trustfall-v0.6.0
Name Modified Size InfoDownloads / Week
Parent folder
README.md 2023-07-25 8.6 kB
trustfall-v0.6.0 source code.tar.gz 2023-07-25 1.3 MB
trustfall-v0.6.0 source code.zip 2023-07-25 1.9 MB
Totals: 3 Items   3.2 MB 0

What's Changed

  • Breaking: the FieldValue::DateTime variant has been removed since it used the unmaintained chrono library (#399)
  • Breaking: FieldValue::String and FieldValue::List now use Arc internally, making FieldValue cheap to clone (#400)
  • Feature: Automatic checker for ensuring Adapter implementations implement their schema and uphold invariants (#384)
  • Feature: TryIntoStruct can now also unpack EdgeParameters (#343)
  • Feature: when querying schemas using SchemaAdapter, it's now possible to query edge parameters' default values (#396)

Feature Highlight: Automatic tests for Adapter implementations (#384)

The new check_adapter_invariants() function is a self-contained adapter tester that can ensure you didn't forget to implement any components of your adapter's schema. Using it is as simple as:

:::rust
pub use trustfall::provider::check_adapter_invariants;

#[test]
fn ensure_adapter_satisfies_invariants() {
    let adapter = todo!("get an `impl Adapter` type");
    let schema = todo!("get a `&Schema` for our adapter");
    check_adapter_invariants(schema, adapter);
}

In addition to catching incomplete schema implementation errors, it also catches violations of other Trustfall adapter invariants, such as context reordering or accidentally dropped data.

For more information, check out its docs: https://github.com/obi1kenobi/trustfall/blob/trustfall-v0.6.0/trustfall_core/src/interpreter/helpers/correctness.rs#L15-L78

Upgrading from Trustfall v0.5.x

The breaking changes should be immaterial to almost all users. Most use cases should be able to upgrade to Trustfall v0.6 without any changes to their own code.

All Merged PRs

Full Changelog: https://github.com/obi1kenobi/trustfall/compare/trustfall-v0.5.1...trustfall-v0.6.0

Source: README.md, updated 2023-07-25