#[derive(Debug, Clone, serde::Serialize)]
pub struct ContinueRequestParams {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: crate::fetch::types::RequestId,
#[serde(rename = "url")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub url: Option<String>,
#[serde(rename = "method")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub method: Option<String>,
#[serde(rename = "postData")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub post_data: Option<String>,
#[serde(rename = "headers")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub headers: Option<Vec<crate::fetch::types::HeaderEntry>>,
#[serde(rename = "interceptResponse")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub intercept_response: Option<bool>,
}
impl<'de> serde::Deserialize<'de> for ContinueRequestParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ContinueRequestParams;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: crate::fetch::types::RequestId,
#[serde(rename = "url")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub url: Option<String>,
#[serde(rename = "method")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub method: Option<String>,
#[serde(rename = "postData")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub post_data: Option<String>,
#[serde(rename = "headers")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub headers: Option<Vec<crate::fetch::types::HeaderEntry>>,
#[serde(rename = "interceptResponse")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub intercept_response: Option<bool>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(ContinueRequestParams {
request_id: fields.request_id,
url: fields.url,
method: fields.method,
post_data: fields.post_data,
headers: fields.headers,
intercept_response: fields.intercept_response,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct ContinueRequest;
#[derive(Debug, Clone, serde::Serialize)]
pub struct ContinueRequestResponse {}
impl<'de> serde::Deserialize<'de> for ContinueRequestResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ContinueRequestResponse;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {}
let _fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(ContinueRequestResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for ContinueRequest {
type Params = ContinueRequestParams;
type Response = ContinueRequestResponse;
const METHOD: &'static str = "Fetch.continueRequest";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct ContinueResponseParams {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: crate::fetch::types::RequestId,
#[serde(rename = "responseCode")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub response_code: Option<i64>,
#[serde(rename = "responsePhrase")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub response_phrase: Option<String>,
#[serde(rename = "responseHeaders")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub response_headers: Option<Vec<crate::fetch::types::HeaderEntry>>,
#[serde(rename = "binaryResponseHeaders")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub binary_response_headers: Option<String>,
}
impl<'de> serde::Deserialize<'de> for ContinueResponseParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ContinueResponseParams;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: crate::fetch::types::RequestId,
#[serde(rename = "responseCode")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub response_code: Option<i64>,
#[serde(rename = "responsePhrase")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub response_phrase: Option<String>,
#[serde(rename = "responseHeaders")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub response_headers: Option<Vec<crate::fetch::types::HeaderEntry>>,
#[serde(rename = "binaryResponseHeaders")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub binary_response_headers: Option<String>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(ContinueResponseParams {
request_id: fields.request_id,
response_code: fields.response_code,
response_phrase: fields.response_phrase,
response_headers: fields.response_headers,
binary_response_headers: fields.binary_response_headers,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct ContinueResponse;
#[derive(Debug, Clone, serde::Serialize)]
pub struct ContinueResponseResponse {}
impl<'de> serde::Deserialize<'de> for ContinueResponseResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ContinueResponseResponse;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {}
let _fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(ContinueResponseResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for ContinueResponse {
type Params = ContinueResponseParams;
type Response = ContinueResponseResponse;
const METHOD: &'static str = "Fetch.continueResponse";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct ContinueWithAuthParams {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: crate::fetch::types::RequestId,
#[serde(rename = "authChallengeResponse")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub auth_challenge_response: crate::fetch::types::AuthChallengeResponse,
}
impl<'de> serde::Deserialize<'de> for ContinueWithAuthParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ContinueWithAuthParams;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: crate::fetch::types::RequestId,
#[serde(rename = "authChallengeResponse")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub auth_challenge_response: crate::fetch::types::AuthChallengeResponse,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(ContinueWithAuthParams {
request_id: fields.request_id,
auth_challenge_response: fields.auth_challenge_response,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct ContinueWithAuth;
#[derive(Debug, Clone, serde::Serialize)]
pub struct ContinueWithAuthResponse {}
impl<'de> serde::Deserialize<'de> for ContinueWithAuthResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = ContinueWithAuthResponse;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {}
let _fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(ContinueWithAuthResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for ContinueWithAuth {
type Params = ContinueWithAuthParams;
type Response = ContinueWithAuthResponse;
const METHOD: &'static str = "Fetch.continueWithAuth";
}
#[derive(Debug, Clone, serde::Serialize, Default)]
pub struct DisableParams {}
impl<'de> serde::Deserialize<'de> for DisableParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = DisableParams;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {}
let _fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(DisableParams {})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct Disable;
#[derive(Debug, Clone, serde::Serialize)]
pub struct DisableResponse {}
impl<'de> serde::Deserialize<'de> for DisableResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = DisableResponse;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {}
let _fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(DisableResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for Disable {
type Params = DisableParams;
type Response = DisableResponse;
const METHOD: &'static str = "Fetch.disable";
}
#[derive(Debug, Clone, serde::Serialize, Default)]
pub struct EnableParams {
#[serde(rename = "patterns")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub patterns: Option<Vec<crate::fetch::types::RequestPattern>>,
#[serde(rename = "handleAuthRequests")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub handle_auth_requests: Option<bool>,
}
impl<'de> serde::Deserialize<'de> for EnableParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = EnableParams;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "patterns")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub patterns: Option<Vec<crate::fetch::types::RequestPattern>>,
#[serde(rename = "handleAuthRequests")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub handle_auth_requests: Option<bool>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(EnableParams {
patterns: fields.patterns,
handle_auth_requests: fields.handle_auth_requests,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct Enable;
#[derive(Debug, Clone, serde::Serialize)]
pub struct EnableResponse {}
impl<'de> serde::Deserialize<'de> for EnableResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = EnableResponse;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {}
let _fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(EnableResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for Enable {
type Params = EnableParams;
type Response = EnableResponse;
const METHOD: &'static str = "Fetch.enable";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct FailRequestParams {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: crate::fetch::types::RequestId,
#[serde(rename = "errorReason")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub error_reason: crate::network::types::ErrorReason,
}
impl<'de> serde::Deserialize<'de> for FailRequestParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = FailRequestParams;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: crate::fetch::types::RequestId,
#[serde(rename = "errorReason")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub error_reason: crate::network::types::ErrorReason,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(FailRequestParams {
request_id: fields.request_id,
error_reason: fields.error_reason,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct FailRequest;
#[derive(Debug, Clone, serde::Serialize)]
pub struct FailRequestResponse {}
impl<'de> serde::Deserialize<'de> for FailRequestResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = FailRequestResponse;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {}
let _fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(FailRequestResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for FailRequest {
type Params = FailRequestParams;
type Response = FailRequestResponse;
const METHOD: &'static str = "Fetch.failRequest";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct FulfillRequestParams {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: crate::fetch::types::RequestId,
#[serde(rename = "responseCode")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub response_code: i64,
#[serde(rename = "responseHeaders")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub response_headers: Option<Vec<crate::fetch::types::HeaderEntry>>,
#[serde(rename = "binaryResponseHeaders")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub binary_response_headers: Option<String>,
#[serde(rename = "body")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub body: Option<String>,
#[serde(rename = "responsePhrase")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub response_phrase: Option<String>,
}
impl<'de> serde::Deserialize<'de> for FulfillRequestParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = FulfillRequestParams;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: crate::fetch::types::RequestId,
#[serde(rename = "responseCode")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub response_code: i64,
#[serde(rename = "responseHeaders")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub response_headers: Option<Vec<crate::fetch::types::HeaderEntry>>,
#[serde(rename = "binaryResponseHeaders")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub binary_response_headers: Option<String>,
#[serde(rename = "body")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub body: Option<String>,
#[serde(rename = "responsePhrase")]
#[serde(
default,
deserialize_with = "ydp_core::binding_support::presence",
skip_serializing_if = "Option::is_none"
)]
pub response_phrase: Option<String>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(FulfillRequestParams {
request_id: fields.request_id,
response_code: fields.response_code,
response_headers: fields.response_headers,
binary_response_headers: fields.binary_response_headers,
body: fields.body,
response_phrase: fields.response_phrase,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct FulfillRequest;
#[derive(Debug, Clone, serde::Serialize)]
pub struct FulfillRequestResponse {}
impl<'de> serde::Deserialize<'de> for FulfillRequestResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = FulfillRequestResponse;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {}
let _fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(FulfillRequestResponse {})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for FulfillRequest {
type Params = FulfillRequestParams;
type Response = FulfillRequestResponse;
const METHOD: &'static str = "Fetch.fulfillRequest";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetResponseBodyParams {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: crate::fetch::types::RequestId,
}
impl<'de> serde::Deserialize<'de> for GetResponseBodyParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetResponseBodyParams;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: crate::fetch::types::RequestId,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetResponseBodyParams {
request_id: fields.request_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct GetResponseBody;
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetResponseBodyResponse {
#[serde(rename = "body")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub body: String,
#[serde(rename = "base64Encoded")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub base64_encoded: bool,
}
impl<'de> serde::Deserialize<'de> for GetResponseBodyResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetResponseBodyResponse;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "body")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub body: String,
#[serde(rename = "base64Encoded")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub base64_encoded: bool,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetResponseBodyResponse {
body: fields.body,
base64_encoded: fields.base64_encoded,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for GetResponseBody {
type Params = GetResponseBodyParams;
type Response = GetResponseBodyResponse;
const METHOD: &'static str = "Fetch.getResponseBody";
}
#[derive(Debug, Clone, serde::Serialize)]
pub struct TakeResponseBodyAsStreamParams {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: crate::fetch::types::RequestId,
}
impl<'de> serde::Deserialize<'de> for TakeResponseBodyAsStreamParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = TakeResponseBodyAsStreamParams;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "requestId")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub request_id: crate::fetch::types::RequestId,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(TakeResponseBodyAsStreamParams {
request_id: fields.request_id,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct TakeResponseBodyAsStream;
#[derive(Debug, Clone, serde::Serialize)]
pub struct TakeResponseBodyAsStreamResponse {
#[serde(rename = "stream")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub stream: crate::io::types::StreamHandle,
}
impl<'de> serde::Deserialize<'de> for TakeResponseBodyAsStreamResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = TakeResponseBodyAsStreamResponse;
fn expecting(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
f.write_str("协议 object")
}
fn visit_map<A: serde::de::MapAccess<'de>>(
self,
a: A,
) -> Result<Self::Value, A::Error> {
#[derive(serde::Deserialize)]
struct Fields {
#[serde(rename = "stream")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub stream: crate::io::types::StreamHandle,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(TakeResponseBodyAsStreamResponse {
stream: fields.stream,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for TakeResponseBodyAsStream {
type Params = TakeResponseBodyAsStreamParams;
type Response = TakeResponseBodyAsStreamResponse;
const METHOD: &'static str = "Fetch.takeResponseBodyAsStream";
}