Skip to content

Releases: elastic-rs/elastic-types

0.19.1

19 Jul 23:35
Compare
Choose a tag to compare
  • Support deriving ElasticDateFormat without requiring you to add chrono to your own crate (#84)
  • Support deriving ElasticType without requiring you to add serde to your own crate (#84)

0.19.0

04 Jul 07:13
Compare
Choose a tag to compare

This release refactors Date to start reducing dependence on chrono::DateTime, and to make sure date formats aren't implicitly changed. Some of these changes might turn out to be too restrictive and may be reverted in the future (allowing formats to change without explicit conversions).

  • Change remap methods to be static methods instead of instance methods
  • Add DateExpr for supporting date math expressions

Changes to Date

  • Change Date<F, M = DefaultDateMapping<F>> to Date<M>. So you can't just write Date<EpochMillis> anymore, it needs to be Date<DefaultDateMapping<EpochMillis>>. This simplifies the generics, and makes Date easier to work with. To get the ergonomics of Date<EpochMillis> back, you can use type aliases:
// For default date types with just a single format
type MyDateType = Date<DefaultDateMapping<EpochMillis>>;

// For default date types with any format
type MyDateType<F> = Date<DefaultDateMappinng<F>>;
  • Adds a DateValue and FormattableDateValue type
  • Use DateValue in the DateFormat::parse and DateFormat::format methods instead of chrono::DateTime
  • Remove the conversion from chrono::DateTime into Date<M> unless M::Format = ChronoFormat. This is because chrono::DateTime is already mappable with the ChronoFormat, so to make sure that formats aren't implicitly changed, you need to convert a chrono::DateTime into a DateValue first, which doesn't have any format:

Before:

let date = Date::from(chrono_date);

After:

let date = Date::from(DateValue::from(chrono_date));

Changes to GeoPoint

  • Like Date, GeoPoint<F, M = DefaultGeoPointMapping<F>> has been changed to GeoPoint<M>. Use the same type aliases approach for ergonomics

0.18.0

22 Jun 22:01
Compare
Choose a tag to compare

0.17.2

11 Jun 21:00
Compare
Choose a tag to compare

0.17.1

30 May 04:34
Compare
Choose a tag to compare
  • Fix a bug when deriving ElasticType in a function scope

0.17.0

25 May 00:25
Compare
Choose a tag to compare
  • Rename Document to IndexDocumentMapping
  • Make Field implementation private

0.16.0

12 May 07:36
Compare
Choose a tag to compare

Initial release to track cargo releases.