pub struct CustomHttpResponse {
pub status_code: u16,
pub headers: HashMap<String, String>,
pub body: Vec<u8>,
pub streaming_strategy: Option<StreamingStrategy>,
pub upgrade: Option<bool>,
}Expand description
http 响应的结构体
Fields§
§status_code: u16响应状态码
headers: HashMap<String, String>响应头
body: Vec<u8>响应体
streaming_strategy: Option<StreamingStrategy>如果有额外的数据需要通过流的方式继续传输 每个 http 请求最大只能支持 3M 的响应数据,因此太大的话需要采用此种方式
upgrade: Option<bool>是否将 HTTP query 请求升级为 update 调用
Trait Implementations§
Source§impl CandidType for CustomHttpResponse
impl CandidType for CustomHttpResponse
Source§impl Clone for CustomHttpResponse
impl Clone for CustomHttpResponse
Source§fn clone(&self) -> CustomHttpResponse
fn clone(&self) -> CustomHttpResponse
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for CustomHttpResponse
impl RefUnwindSafe for CustomHttpResponse
impl Send for CustomHttpResponse
impl Sync for CustomHttpResponse
impl Unpin for CustomHttpResponse
impl UnsafeUnpin for CustomHttpResponse
impl UnwindSafe for CustomHttpResponse
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