pub struct Response {
pub config: Config,
pub status: Status,
pub headers: BTreeMap<String, String>,
pub cookies: BTreeMap<String, String>,
pub body: Vec<u8>,
pub body_text: JsonValue,
pub content_encoding: String,
}
Expand description
响应
Fields§
§config: Config
§status: Status
§headers: BTreeMap<String, String>
§body: Vec<u8>
消息体
body_text: JsonValue
§content_encoding: String
Implementations§
Source§impl Response
impl Response
pub fn new(config: Config) -> Self
pub fn status(&mut self, code: i32) -> &mut Self
Sourcepub fn set_compress(&mut self, value: Vec<String>) -> &mut Self
pub fn set_compress(&mut self, value: Vec<String>) -> &mut Self
设置压缩
pub fn header(&mut self, key: &str, value: &str) -> &mut Self
pub fn set_server(&mut self, name: &str)
pub fn get_date(&mut self) -> String
pub fn websocket(&mut self, key: String) -> &mut Self
pub fn send(&mut self, scheme: Scheme) -> Result<()>
Trait Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)