pub struct Response { /* private fields */ }Expand description
Response 本地状态。
@trace REQ-BAO-API-006 [class:Response]
Implementations§
Source§impl Response
impl Response
Sourcepub fn new() -> Response
pub fn new() -> Response
构造空 Response(由 responseReceived 事件填入)。
@trace REQ-BAO-API-006 [class:Response]
Sourcepub fn set_status(&self, s: u16)
pub fn set_status(&self, s: u16)
设置 status。
@trace REQ-BAO-API-006 [class:Response]
Sourcepub fn status_text(&self) -> String
pub fn status_text(&self) -> String
Status text。
@trace REQ-BAO-API-006 [class:Response]
Sourcepub fn set_status_text(&self, t: impl Into<String>)
pub fn set_status_text(&self, t: impl Into<String>)
设置 status text。
@trace REQ-BAO-API-006 [class:Response]
Sourcepub fn headers(&self) -> HashMap<String, String>
pub fn headers(&self) -> HashMap<String, String>
Headers(克隆)。
@trace REQ-BAO-API-006 [class:Response]
Sourcepub fn set_headers(&self, h: HashMap<String, String>)
pub fn set_headers(&self, h: HashMap<String, String>)
设置 headers。
@trace REQ-BAO-API-006 [class:Response]
Sourcepub fn add_header(&self, name: impl Into<String>, value: impl Into<String>)
pub fn add_header(&self, name: impl Into<String>, value: impl Into<String>)
添加单个 header。
@trace REQ-BAO-API-006 [class:Response]
Sourcepub fn from_cache(&self) -> bool
pub fn from_cache(&self) -> bool
是否来自 cache。
@trace REQ-BAO-API-006 [class:Response]
Sourcepub fn set_from_cache(&self, v: bool)
pub fn set_from_cache(&self, v: bool)
设置 from_cache。
@trace REQ-BAO-API-006 [class:Response]
Sourcepub fn from_service_worker(&self) -> bool
pub fn from_service_worker(&self) -> bool
是否来自 service worker。
@trace REQ-BAO-API-006 [class:Response]
Sourcepub fn set_from_service_worker(&self, v: bool)
pub fn set_from_service_worker(&self, v: bool)
设置 from_service_worker。
@trace REQ-BAO-API-006 [class:Response]
Sourcepub fn security_details(&self) -> Option<SecurityDetails>
pub fn security_details(&self) -> Option<SecurityDetails>
TLS security details(本地缓存)。
@trace REQ-BAO-API-006 [class:Response]
Sourcepub fn set_security_details(&self, s: SecurityDetails)
pub fn set_security_details(&self, s: SecurityDetails)
设置 security details。
@trace REQ-BAO-API-006 [class:Response]
Sourcepub fn remote_address(&self) -> Option<RemoteAddress>
pub fn remote_address(&self) -> Option<RemoteAddress>
Remote address。
@trace REQ-BAO-API-006 [class:Response]
Sourcepub fn set_remote_address(&self, a: RemoteAddress)
pub fn set_remote_address(&self, a: RemoteAddress)
设置 remote address。
@trace REQ-BAO-API-006 [class:Response]
Sourcepub fn request(&self) -> Option<Rc<Request>>
pub fn request(&self) -> Option<Rc<Request>>
关联 Request。
@trace REQ-BAO-API-006 [class:Response]
Sourcepub fn set_request(&self, r: Rc<Request>)
pub fn set_request(&self, r: Rc<Request>)
设置 request(双向链接)。
@trace REQ-BAO-API-006 [class:Response]
Sourcepub fn body(&self) -> Option<Vec<u8>>
pub fn body(&self) -> Option<Vec<u8>>
body bytes(本地缓存)。
@trace REQ-BAO-API-006 [class:Response]
Sourcepub fn body_text(&self) -> Option<String>
pub fn body_text(&self) -> Option<String>
body text(本地缓存)。
@trace REQ-BAO-API-006 [class:Response]
Sourcepub fn set_body_text(&self, t: impl Into<String>)
pub fn set_body_text(&self, t: impl Into<String>)
设置 body text。
@trace REQ-BAO-API-006 [class:Response]
Sourcepub fn body_json(&self) -> Option<Value>
pub fn body_json(&self) -> Option<Value>
body JSON(本地缓存)。
@trace REQ-BAO-API-006 [class:Response]
Sourcepub fn set_body_json(&self, v: Value)
pub fn set_body_json(&self, v: Value)
设置 body JSON。
@trace REQ-BAO-API-006 [class:Response]
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Response
impl !RefUnwindSafe for Response
impl !Send for Response
impl !Sync for Response
impl !UnwindSafe for Response
impl Unpin for Response
impl UnsafeUnpin for Response
Blanket Implementations§
Source§impl<T> AsCtxPtr for Twhere
T: ?Sized,
impl<T> AsCtxPtr for Twhere
T: ?Sized,
Source§fn as_ctx_ptr(&self) -> *mut Selfwhere
Self: Sized,
fn as_ctx_ptr(&self) -> *mut Selfwhere
Self: Sized,
self’s address as *mut Self for deferred-task / scopeguard /
ref_guard ctx slots. The closures/trampolines deref it as shared
(&*p) — every method they reach is &self post-R-2, so no write
provenance is required; the *mut spelling is purely to match the
existing DerefOnDrop / HasAutoFlush / RefCount ABI.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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(DataRequest<'_>) -> bool>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more