#[derive(Debug, Clone, serde::Serialize)]
pub struct GetFeatureStateParams {
#[serde(rename = "featureState")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub feature_state: String,
}
impl<'de> serde::Deserialize<'de> for GetFeatureStateParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetFeatureStateParams;
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 = "featureState")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub feature_state: String,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetFeatureStateParams {
feature_state: fields.feature_state,
})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct GetFeatureState;
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetFeatureStateResponse {
#[serde(rename = "featureEnabled")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub feature_enabled: bool,
}
impl<'de> serde::Deserialize<'de> for GetFeatureStateResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetFeatureStateResponse;
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 = "featureEnabled")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub feature_enabled: bool,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetFeatureStateResponse {
feature_enabled: fields.feature_enabled,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for GetFeatureState {
type Params = GetFeatureStateParams;
type Response = GetFeatureStateResponse;
const METHOD: &'static str = "SystemInfo.getFeatureState";
}
#[derive(Debug, Clone, serde::Serialize, Default)]
pub struct GetInfoParams {}
impl<'de> serde::Deserialize<'de> for GetInfoParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetInfoParams;
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(GetInfoParams {})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct GetInfo;
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetInfoResponse {
#[serde(rename = "gpu")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub gpu: crate::system_info::types::GpuInfo,
#[serde(rename = "modelName")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub model_name: String,
#[serde(rename = "modelVersion")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub model_version: String,
#[serde(rename = "commandLine")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub command_line: String,
}
impl<'de> serde::Deserialize<'de> for GetInfoResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetInfoResponse;
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 = "gpu")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub gpu: crate::system_info::types::GpuInfo,
#[serde(rename = "modelName")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub model_name: String,
#[serde(rename = "modelVersion")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub model_version: String,
#[serde(rename = "commandLine")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub command_line: String,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetInfoResponse {
gpu: fields.gpu,
model_name: fields.model_name,
model_version: fields.model_version,
command_line: fields.command_line,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for GetInfo {
type Params = GetInfoParams;
type Response = GetInfoResponse;
const METHOD: &'static str = "SystemInfo.getInfo";
}
#[derive(Debug, Clone, serde::Serialize, Default)]
pub struct GetProcessInfoParams {}
impl<'de> serde::Deserialize<'de> for GetProcessInfoParams {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetProcessInfoParams;
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(GetProcessInfoParams {})
}
}
d.deserialize_map(Visitor)
}
}
#[derive(Debug, Clone, Copy)]
pub struct GetProcessInfo;
#[derive(Debug, Clone, serde::Serialize)]
pub struct GetProcessInfoResponse {
#[serde(rename = "processInfo")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub process_info: Vec<crate::system_info::types::ProcessInfo>,
}
impl<'de> serde::Deserialize<'de> for GetProcessInfoResponse {
fn deserialize<D: serde::Deserializer<'de>>(d: D) -> Result<Self, D::Error> {
struct Visitor;
impl<'de> serde::de::Visitor<'de> for Visitor {
type Value = GetProcessInfoResponse;
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 = "processInfo")]
#[serde(deserialize_with = "ydp_core::binding_support::required")]
pub process_info: Vec<crate::system_info::types::ProcessInfo>,
}
let fields = <Fields as serde::Deserialize>::deserialize(
serde::de::value::MapAccessDeserializer::new(a),
)?;
Ok(GetProcessInfoResponse {
process_info: fields.process_info,
})
}
}
d.deserialize_map(Visitor)
}
}
impl ydp_core::Command for GetProcessInfo {
type Params = GetProcessInfoParams;
type Response = GetProcessInfoResponse;
const METHOD: &'static str = "SystemInfo.getProcessInfo";
}