Struct summer_boot::utils::response::Response
source · pub struct Response { /* private fields */ }
Expand description
HTTP response
Implementations§
source§impl Response
impl Response
pub fn builder<S>(status: S) -> ResponseBuilder
pub fn status(&self) -> StatusCode
pub fn set_status<S>(&mut self, status: S)
pub fn len(&self) -> Option<usize>
pub fn is_empty(&self) -> Option<bool>
pub fn header(&self, name: impl Into<HeaderName>) -> Option<&HeaderValues>
pub fn header_mut( &mut self, name: impl Into<HeaderName> ) -> Option<&mut HeaderValues>
pub fn remove_header( &mut self, name: impl Into<HeaderName> ) -> Option<HeaderValues>
pub fn insert_header( &mut self, key: impl Into<HeaderName>, value: impl ToHeaderValues )
pub fn append_header( &mut self, key: impl Into<HeaderName>, value: impl ToHeaderValues )
pub fn iter(&self) -> Iter<'_>
pub fn iter_mut(&mut self) -> IterMut<'_>
pub fn header_names(&self) -> Names<'_>
pub fn header_values(&self) -> Values<'_>
pub fn content_type(&self) -> Option<Mime>
pub fn set_content_type(&mut self, mime: impl Into<Mime>)
pub fn take_body(&mut self) -> Body
pub fn swap_body(&mut self, body: &mut Body)
pub fn body_json(&mut self, json: &impl Serialize) -> Result<()>
pub fn body_string(&mut self, string: String)
pub fn body_bytes(&mut self, bytes: impl AsRef<[u8]>)
pub async fn body_file(&mut self, path: impl AsRef<Path>) -> Result<()>
pub fn error(&self) -> Option<&Error>
pub fn downcast_error<E>(&self) -> Option<&E>
pub fn take_error(&mut self) -> Option<Error>
pub fn set_error(&mut self, error: impl Into<Error>)
pub fn ext<T: Send + Sync + 'static>(&self) -> Option<&T>
pub fn insert_ext<T: Send + Sync + 'static>(&mut self, val: T)
pub fn from_res<T>(value: T) -> Self
Trait Implementations§
source§impl From<ResponseBuilder> for Response
impl From<ResponseBuilder> for Response
source§fn from(response_builder: ResponseBuilder) -> Response
fn from(response_builder: ResponseBuilder) -> Response
Converts to this type from the input type.
source§impl From<StatusCode> for Response
impl From<StatusCode> for Response
source§fn from(status: StatusCode) -> Self
fn from(status: StatusCode) -> Self
Converts to this type from the input type.
source§impl Index<HeaderName> for Response
impl Index<HeaderName> for Response
§type Output = HeaderValues
type Output = HeaderValues
The returned type after indexing.
source§fn index(&self, name: HeaderName) -> &HeaderValues
fn index(&self, name: HeaderName) -> &HeaderValues
Performs the indexing (
container[index]
) operation. Read moresource§impl<'a> IntoIterator for &'a Response
impl<'a> IntoIterator for &'a Response
source§impl<'a> IntoIterator for &'a mut Response
impl<'a> IntoIterator for &'a mut Response
Auto Trait Implementations§
impl !RefUnwindSafe for Response
impl Send for Response
impl Sync for Response
impl Unpin for Response
impl !UnwindSafe for Response
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