pub struct Response { /* private fields */ }Expand description
响应体
use silent::Response;
let req = Response::empty();Implementations§
source§impl Response
impl Response
sourcepub fn set_status(&mut self, status: StatusCode)
pub fn set_status(&mut self, status: StatusCode)
设置响应状态
sourcepub fn set_header(self, key: HeaderName, value: HeaderValue) -> Self
pub fn set_header(self, key: HeaderName, value: HeaderValue) -> Self
设置响应header
sourcepub fn extensions(&self) -> &Extensions
pub fn extensions(&self) -> &Extensions
获取extensions
sourcepub fn extensions_mut(&mut self) -> &mut Extensions
pub fn extensions_mut(&mut self) -> &mut Extensions
获取extensions_mut
sourcepub fn get_config_uncheck<T: Send + Sync + 'static>(&self) -> &T
pub fn get_config_uncheck<T: Send + Sync + 'static>(&self) -> &T
获取配置(Uncheck)
sourcepub fn configs_mut(&mut self) -> &mut Configs
pub fn configs_mut(&mut self) -> &mut Configs
获取可变全局配置
sourcepub fn headers_mut(&mut self) -> &mut HeaderMap
pub fn headers_mut(&mut self) -> &mut HeaderMap
设置响应header
sourcepub fn content_length(&self) -> SizeHint
pub fn content_length(&self) -> SizeHint
获取响应体长度
sourcepub fn set_typed_header<H>(&mut self, header: H)where
H: Header,
pub fn set_typed_header<H>(&mut self, header: H)where
H: Header,
设置响应header
sourcepub fn copy_from_response(&mut self, res: Response)
pub fn copy_from_response(&mut self, res: Response)
move response to from another response
Trait Implementations§
source§impl From<SilentError> for Response
impl From<SilentError> for Response
source§fn from(value: SilentError) -> Self
fn from(value: SilentError) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !Freeze for Response
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