Struct tauri::http::Response
x3A;:Response,
pub struct Response {
pub head: ResponseParts,
pub body: Vec<u8, Global>,
}
Expand description
Represents an HTTP response
An HTTP response consists of a head and a potentially body.
Platform-specific#
- Linux: Headers and status code cannot be changed.
#
Exampleslet response = ResponseBuilder::new()
.status(202)
.mimetype("text/html")
.body("hello!".as_bytes().to_vec())
.unwrap();
#
Fieldshead: ResponseParts``body: Vec<u8, Global>
#
ImplementationsResponse#
implnew(body: Vec<u8, Global>) -> Response#
pub fnCreates a new blank Response
with the body
status(&self) -> StatusCode#
pub fnReturns the StatusCode
.
mimetype(&self) -> Option<String>#
pub fnReturns a reference to the mime type.
version(&self) -> Version#
pub fnReturns a reference to the associated version.
headers(&self) -> &HeaderMap<HeaderValue>#
pub fnReturns a reference to the associated header field map.
body(&self) -> &Vec<u8, Global>#
pub fnReturns a reference to the associated HTTP body.
#
Trait ImplementationsDebug for Response#
implfmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>#
pub fnFormats the value using the given formatter. Read more
Default for Response#
impldefault() -> Response#
pub fnReturns the “default value” for a type. Read more
#
Auto Trait ImplementationsRefUnwindSafe for Response#
implSend for Response#
implSync for Response#
implUnpin for Response#
implUnwindSafe for Response#
impl#
Blanket ImplementationsAny for T where T: 'static + ?Sized,[src]#
impl<T>type_id(&self) -> TypeId[src]#
pub fnGets the TypeId
of self
. Read more
Borrow<T> for T where T: ?Sized,[src]#
impl<T>borrow(&self) -> &T[src]#
pub fnImmutably borrows from an owned value. Read more
BorrowMut<T> for T where T: ?Sized,[src]#
impl<T>borrow_mut(&mut self) -> &mutT[src]#
pub fnMutably borrows from an owned value. Read more
From<T> for T[src]#
impl<T>from(t: T) -> T[src]#
pub fnPerforms the conversion.
Into<U> for T where U: From<T>,[src]#
impl<T, U>into(self) -> U[src]#
pub fnPerforms the conversion.
TryFrom<U> for T where U: Into<T>,[src]#
impl<T, U>Error = Infallible#
typeThe type returned in the event of a conversion error.
try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]#
pub fnPerforms the conversion.
TryInto<U> for T where U: TryFrom<T>,[src]#
impl<T, U>Error = <U as TryFrom<T>>::Error#
typeThe type returned in the event of a conversion error.
try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]#
pub fnPerforms the conversion.