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 request: Request,
}
Expand description
响应
Fields§
§config: Config
§status: Status
§headers: BTreeMap<String, String>
§body: Vec<u8>
消息体
body_text: JsonValue
§request: Request
请求信息
Implementations§
Source§impl Response
impl Response
pub fn status(&mut self, code: i32) -> &mut Self
Sourcepub fn set_request(&mut self, request: Request) -> &mut Self
pub fn set_request(&mut self, request: Request) -> &mut Self
设置 请求内容
pub fn header(&mut self, key: &str, value: &str) -> &mut Self
pub fn update_body(&mut self)
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