Rust SDK 0.4.0

rust-sdkremoveddeprecatedchangedadded

Added

  • Added get_header_value method to fastly::request::RequestHandle.

  • Added specific error types for some API calls:

  • fastly::error::SendError is returned by APIs that send backend requests. Note that the common case for a failed request remains an Ok result with a 5xx status code response.

  • fastly::error::BufferSizeError is returned by handle API calls that can fail due to an insufficient buffer size.

  • Added RequestExt::send_async_streaming() and RequestHandle::send_async_streaming(), which allow programs to continue writing bytes to upstream request bodies after the headers have been sent.

  • Added Backend::name() to get the string representation of a backend.

  • Added ResponseExt::backend() to retrieve the Backend a response came from.

  • Added ResponseExt::backend_request() and ResponseExt::take_backend_request() to retrieve the Request that this response was returned from, minus the body which is consumed when the request is sent. The take variant takes ownership of the Request so that it can be subsequently reused for another backend request.

  • Added PendingRequest::sent_req() to retrieve the Request that was sent, minus the body which is consumed when the request is sent.

Changed

  • Removed Result return types from various functions and methods. Internal errors will now cause a panic. This primarily impacts the Body, BodyHandle, RequestHandle, and ResponseHandle types. This helps remove noise from ? operators in cases where user programs cannot realistically recover from the error.

  • get_header_value methods for RequestHandle and ResponseHandle will now return Ok(None) if the header does not exist, rather than an empty header.

  • Response::send_downstream() and ResponseHandle::send_downstream() now begin sending the responses immediately, rather than when the program exits.

  • Renamed Backend::new() to Backend::from_name(), and deprecated the old name.

Deprecated

  • Deprecated Backend::new() in favor of Backend::from_name().

Removed

  • Removed fastly::abi submodule from the public interface.

  • Removed impl From<PendingRequestHandle> for PendingRequest, as PendingRequests now must be build with the backend Request they were sent with.

Prior change: CLI v0.13.0

Following change: CLI v0.14.0