You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Provide a way for users to access "trailer headers" as defined in RFC 7230. Trailer headers are headers delivered after the response body has been consumed with chunked encoding.
Accessing the trailer is tricky because it can make APIs look awkward since it violates the traditional flow of a response. Here's one possible API:
// Existing traitpubtraitResponseExt{// New method, returns an object that provides access to the trailer, if a trailer// is expected.fntrailer(&self) -> Option<&Trailer>;}pubstructTrailer{// ...}implTrailer{// Get the currently available trailer headers. May be None if the trailer has// not yet arrived.pubfnheaders(&self) -> Option<&HeaderMap>;// Block the current thread until the trailer is received, or the transfer// completes, whichever comes first.pubfnwait(&self);// Wait for the trailer to arrive asynchronously.pubasyncfnarrive(&self);}
The text was updated successfully, but these errors were encountered:
Provide a way for users to access "trailer headers" as defined in RFC 7230. Trailer headers are headers delivered after the response body has been consumed with chunked encoding.
Accessing the trailer is tricky because it can make APIs look awkward since it violates the traditional flow of a response. Here's one possible API:
The text was updated successfully, but these errors were encountered: