Rust SDK 0.8.0

rust-sdkremovedchangedfixedadded

Added

  • Added Dictionary::try_get, which returns a Result<String, LookupError>, allowing programs to explicitly handle lookup failures.
  • Added an Other variant to dictionary::LookupError.
  • Added close to RequestHandle, and ResponseHandle.
  • Added the non_exhaustive enums HandleError and HandleKind for the low level handle interface.
  • Added Satellite and UltraBroadband variants for ConnSpeed and ConnType in the geolocation interface.
  • Added Other variants for ConnSpeed, ConnType, Continent, ProxyDescription, and ProxyType in the geolocation interface for cases where the geolocation database contains variants that are newer than the current SDK definitions.

Fixed

  • Fixed geolocation calls returning no data when only partial data was available for a requested IP address.

Changed

  • The Minimum Supported Rust Version (MSRV) for the fastly crate is now 1.54.0.
  • BodyHandle::close now works for non-streaming bodies in addition to the already-closeable streaming bodies.
  • BodyHandle, RequestHandle and ResponseHandle now call close as part of their Drop implementation when they go out of scope, saving a small amount of leaked memory for services that make multiple HTTP requests.
  • Exported unsafe low-level interfaces for creating BodyHandles.
  • The functions is_valid and is_invalid are now const for BodyHandle, RequestHandle, and ResponseHandle
  • Geo::utc_offset now returns Option<time::UtcOffset> instead of Option<chrono::FixedOffset>.
  • ConnSpeed, ConnType, ProxyDescription, and ProxyType are now non_exhaustive.
  • Exported the fastly::dictionary module. Its exported types Dictionary and LookupError remain accessible through other paths, but this module provides a way to import them together.

Removed

  • Removed Copy from ConnSpeed, ConnType, Continent, ProxyDescription and ProxyType inside the geo module; their new Other variants contain an arbitrary String which is not Copyable. The strings the Other variant might contain are small, so these enums (and Geo itself) can be efficiently cloned.

Prior change: JavaScript SDK 0.2.0

Following change: CLI v0.37.0