pub struct HttpResponseBinary { /* private fields */ }
Expand description
A struct representing an HTTP response.
This struct contains all the components of an HTTP response: the HTTP version, status code, status text, headers, and body. It is used to model and manipulate HTTP responses within the application.
§Fields
http_version
: A string representing the HTTP version.status_code
: The HTTP status code.status_text
: A string containing the status text associated with the status code.headers
: AHashMap<String, String>
containing the headers of the response, where each key is the header name and the value is the corresponding header value.body
: AVec<u8>
representing the body of the HTTP response, which contains the content being returned.
Implementations§
Source§impl HttpResponseBinary
impl HttpResponseBinary
Sourcepub fn get_http_version(&self) -> HttpVersion
pub fn get_http_version(&self) -> HttpVersion
Sourcepub fn get_status_code(&self) -> ResponseStatusCode
pub fn get_status_code(&self) -> ResponseStatusCode
Sourcepub fn get_status_text(&self) -> String
pub fn get_status_text(&self) -> String
Sourcepub fn get_headers(&self) -> ResponseHeaders
pub fn get_headers(&self) -> ResponseHeaders
Sourcepub fn get_body(&self) -> RequestBody
pub fn get_body(&self) -> RequestBody
Trait Implementations§
Source§impl Clone for HttpResponseBinary
impl Clone for HttpResponseBinary
Source§fn clone(&self) -> HttpResponseBinary
fn clone(&self) -> HttpResponseBinary
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for HttpResponseBinary
impl Debug for HttpResponseBinary
Source§impl Default for HttpResponseBinary
Default implementation for HttpResponseBinary.
impl Default for HttpResponseBinary
Default implementation for HttpResponseBinary.
§Returns
HttpResponseBinary
- Default initialized HttpResponseBinary.
Source§impl ResponseTrait for HttpResponseBinary
Implements the ResponseTrait
trait for HttpResponseBinary
.
impl ResponseTrait for HttpResponseBinary
Implements the ResponseTrait
trait for HttpResponseBinary
.
This implementation specifies the associated types for binary and text representations of HTTP responses, enabling seamless conversion and handling of HTTP response data.
§Associated Types
OutputText
: Specifies the text representation of an HTTP response (HttpResponseText
).OutputBinary
: Specifies the binary representation of an HTTP response (HttpResponseBinary
).
Source§fn binary(&self) -> Self::OutputBinary
fn binary(&self) -> Self::OutputBinary
Converts the response to binary format.
§Returns
Self::OutputBinary
- The binary representation of the response.
Source§fn text(&self) -> HttpResponseText
fn text(&self) -> HttpResponseText
Converts the response to text format.
§Returns
HttpResponseText
- The text representation of the response.
Source§fn decode(&self, buffer_size: usize) -> HttpResponseBinary
fn decode(&self, buffer_size: usize) -> HttpResponseBinary
type OutputText = HttpResponseText
type OutputBinary = HttpResponseBinary
Auto Trait Implementations§
impl Freeze for HttpResponseBinary
impl RefUnwindSafe for HttpResponseBinary
impl Send for HttpResponseBinary
impl Sync for HttpResponseBinary
impl Unpin for HttpResponseBinary
impl UnwindSafe for HttpResponseBinary
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more