pub struct Response<'a> { /* private fields */ }Expand description
HTTP response data.
Implementations§
Source§impl<'a> Response<'a>
impl<'a> Response<'a>
Sourcepub fn builder(
url: impl Into<Cow<'a, str>>,
status: i64,
status_text: impl Into<Cow<'a, str>>,
headers: Headers,
mime_type: impl Into<Cow<'a, str>>,
charset: impl Into<Cow<'a, str>>,
connection_reused: bool,
connection_id: f64,
encoded_data_length: f64,
security_state: SecurityState,
) -> ResponseBuilder<'a>
pub fn builder( url: impl Into<Cow<'a, str>>, status: i64, status_text: impl Into<Cow<'a, str>>, headers: Headers, mime_type: impl Into<Cow<'a, str>>, charset: impl Into<Cow<'a, str>>, connection_reused: bool, connection_id: f64, encoded_data_length: f64, security_state: SecurityState, ) -> ResponseBuilder<'a>
Creates a builder for this type with the required parameters:
url: Response URL. This URL can be different from CachedResource.url in case of redirect.status: HTTP response status code.status_text: HTTP response status text.headers: HTTP response headers.mime_type: Resource mimeType as determined by the browser.charset: Resource charset as determined by the browser (if applicable).connection_reused: Specifies whether physical connection was actually reused for this request.connection_id: Physical connection id that was actually used for this request.encoded_data_length: Total number of bytes received for this request so far.security_state: Security state of the request resource.
Sourcepub fn url(&self) -> &str
pub fn url(&self) -> &str
Response URL. This URL can be different from CachedResource.url in case of redirect.
Sourcepub fn status_text(&self) -> &str
pub fn status_text(&self) -> &str
HTTP response status text.
Sourcepub fn headers_text(&self) -> Option<&str>
pub fn headers_text(&self) -> Option<&str>
HTTP response headers text. This has been replaced by the headers in Network.responseReceivedExtraInfo.
Sourcepub fn request_headers(&self) -> Option<&Headers>
pub fn request_headers(&self) -> Option<&Headers>
Refined HTTP request headers that were actually transmitted over the network.
Sourcepub fn request_headers_text(&self) -> Option<&str>
pub fn request_headers_text(&self) -> Option<&str>
HTTP request headers text. This has been replaced by the headers in Network.requestWillBeSentExtraInfo.
Sourcepub fn connection_reused(&self) -> bool
pub fn connection_reused(&self) -> bool
Specifies whether physical connection was actually reused for this request.
Sourcepub fn connection_id(&self) -> f64
pub fn connection_id(&self) -> f64
Physical connection id that was actually used for this request.
Sourcepub fn remote_ip_address(&self) -> Option<&str>
pub fn remote_ip_address(&self) -> Option<&str>
Remote IP address.
Sourcepub fn remote_port(&self) -> Option<i64>
pub fn remote_port(&self) -> Option<i64>
Remote port.
Sourcepub fn from_disk_cache(&self) -> Option<bool>
pub fn from_disk_cache(&self) -> Option<bool>
Specifies that the request was served from the disk cache.
Sourcepub fn from_service_worker(&self) -> Option<bool>
pub fn from_service_worker(&self) -> Option<bool>
Specifies that the request was served from the ServiceWorker.
Sourcepub fn from_prefetch_cache(&self) -> Option<bool>
pub fn from_prefetch_cache(&self) -> Option<bool>
Specifies that the request was served from the prefetch cache.
Sourcepub fn from_early_hints(&self) -> Option<bool>
pub fn from_early_hints(&self) -> Option<bool>
Specifies that the request was served from the prefetch cache.
Sourcepub fn service_worker_router_info(&self) -> Option<&ServiceWorkerRouterInfo>
pub fn service_worker_router_info(&self) -> Option<&ServiceWorkerRouterInfo>
Information about how ServiceWorker Static Router API was used. If this field is set with ‘matchedSourceType’ field, a matching rule is found. If this field is set without ‘matchedSource’, no matching rule is found. Otherwise, the API is not used.
Sourcepub fn encoded_data_length(&self) -> f64
pub fn encoded_data_length(&self) -> f64
Total number of bytes received for this request so far.
Sourcepub fn timing(&self) -> Option<&ResourceTiming>
pub fn timing(&self) -> Option<&ResourceTiming>
Timing information for the given request.
Sourcepub fn service_worker_response_source(
&self,
) -> Option<&ServiceWorkerResponseSource>
pub fn service_worker_response_source( &self, ) -> Option<&ServiceWorkerResponseSource>
Response source of response from ServiceWorker.
Sourcepub fn response_time(&self) -> Option<&TimeSinceEpoch>
pub fn response_time(&self) -> Option<&TimeSinceEpoch>
The time at which the returned response was generated.
Sourcepub fn cache_storage_cache_name(&self) -> Option<&str>
pub fn cache_storage_cache_name(&self) -> Option<&str>
Cache Storage Cache Name.
Sourcepub fn alternate_protocol_usage(&self) -> Option<&AlternateProtocolUsage>
pub fn alternate_protocol_usage(&self) -> Option<&AlternateProtocolUsage>
The reason why Chrome uses a specific transport protocol for HTTP semantics.
Sourcepub fn security_state(&self) -> &SecurityState
pub fn security_state(&self) -> &SecurityState
Security state of the request resource.
Sourcepub fn security_details(&self) -> Option<&SecurityDetails<'a>>
pub fn security_details(&self) -> Option<&SecurityDetails<'a>>
Security details for the request.