Rust SDK 0.4.0
Added
Added
get_header_valuemethod tofastly::request::RequestHandle.Added specific error types for some API calls:
fastly::error::SendErroris returned by APIs that send backend requests. Note that the common case for a failed request remains anOkresult with a 5xx status code response.fastly::error::BufferSizeErroris returned by handle API calls that can fail due to an insufficient buffer size.Added
RequestExt::send_async_streaming()andRequestHandle::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 theBackenda response came from.Added
ResponseExt::backend_request()andResponseExt::take_backend_request()to retrieve theRequestthat this response was returned from, minus the body which is consumed when the request is sent. Thetakevariant takes ownership of theRequestso that it can be subsequently reused for another backend request.Added
PendingRequest::sent_req()to retrieve theRequestthat was sent, minus the body which is consumed when the request is sent.
Changed
Removed
Resultreturn types from various functions and methods. Internal errors will now cause a panic. This primarily impacts theBody,BodyHandle,RequestHandle, andResponseHandletypes. This helps remove noise from?operators in cases where user programs cannot realistically recover from the error.get_header_valuemethods forRequestHandleandResponseHandlewill now returnOk(None)if the header does not exist, rather than an empty header.Response::send_downstream()andResponseHandle::send_downstream()now begin sending the responses immediately, rather than when the program exits.Renamed
Backend::new()toBackend::from_name(), and deprecated the old name.
Deprecated
- Deprecated
Backend::new()in favor ofBackend::from_name().
Removed
Removed
fastly::abisubmodule from the public interface.Removed
impl From<PendingRequestHandle> for PendingRequest, asPendingRequestsnow must be build with the backendRequestthey were sent with.
Prior change: Rust SDK 0.3.3
Following change: Rust SDK 0.4.1