Struct summer_boot::utils::response_builder::ResponseBuilder
source · pub struct ResponseBuilder(/* private fields */);Implementations§
source§impl ResponseBuilder
impl ResponseBuilder
pub fn build(self) -> Response
pub fn header( self, key: impl Into<HeaderName>, value: impl ToHeaderValues ) -> Self
pub fn content_type(self, content_type: impl Into<Mime>) -> Self
pub fn body(self, body: impl Into<Body>) -> Self
pub fn body_json(self, json: &impl Serialize) -> Result<Self>
pub fn body_string(self, string: String) -> Self
pub fn body_bytes(self, bytes: impl AsRef<[u8]>) -> Self
pub async fn body_file(self, path: impl AsRef<Path>) -> Result<Self>
Trait Implementations§
source§impl Debug for ResponseBuilder
impl Debug for ResponseBuilder
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.
Auto Trait Implementations§
impl !RefUnwindSafe for ResponseBuilder
impl Send for ResponseBuilder
impl Sync for ResponseBuilder
impl Unpin for ResponseBuilder
impl !UnwindSafe for ResponseBuilder
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