pub struct Request {Show 24 fields
pub config: Config,
pub header_line: String,
pub protocol: Protocol,
pub method: Method,
pub uri: Uri,
pub origin: String,
pub header: JsonValue,
pub cookie: JsonValue,
pub query: JsonValue,
pub params: JsonValue,
pub authorization: Authorization,
pub handle_time: String,
pub datetime: String,
pub timestamp: i64,
pub client_ip: String,
pub proxy_ip: String,
pub server_ip: String,
pub upgrade: Upgrade,
pub connection: Connection,
pub accept_encoding: Encoding,
pub body_data: Vec<u8>,
pub content_type: ContentType,
pub scheme: Arc<Mutex<Scheme>>,
pub accept_language: Language,
/* private fields */
}Expand description
请求体
Fields§
§config: Config§header_line: String头行
protocol: Protocol协议版本
method: Method当前请求类型
uri: Uri资源标识符
origin: String源站
header: JsonValueheader信息
Cookie信息
query: JsonValue查询参数
params: JsonValue请求参数
认证信息
handle_time: String处理耗时
datetime: String请求时间
timestamp: i64请求时间戳
client_ip: String客户端IP
proxy_ip: String代理端IP
server_ip: String服务端IP
upgrade: Upgrade§connection: Connection连接方式
accept_encoding: Encoding压缩方式
body_data: Vec<u8>请求体数据
content_type: ContentType消息体类型
scheme: Arc<Mutex<Scheme>>§accept_language: Language接受语音
Implementations§
Source§impl Request
impl Request
pub fn new(config: Config, scheme: Arc<Mutex<Scheme>>) -> Self
pub fn handle(&mut self) -> Result<(), HttpError>
pub fn handle_header(&mut self, data: Vec<u8>) -> Result<(), HttpError>
pub fn set_header(&mut self, key: &str, value: &str) -> Result<(), HttpError>
pub fn handle_body(&mut self, data: Vec<u8>) -> Result<(), HttpError>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Request
impl RefUnwindSafe for Request
impl Send for Request
impl Sync for Request
impl Unpin for Request
impl UnwindSafe for Request
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