opensearch_client/core/search/
query_profile.rs1use crate::core;
12use serde::{Deserialize, Serialize};
13
14
15
16
17#[derive(Clone, Default, Debug, PartialEq, Serialize, Deserialize)]
18pub struct QueryProfile {
19 #[serde(rename = "breakdown")]
20 pub breakdown: core::search::QueryBreakdown,
21 #[serde(rename = "description")]
22 pub description: String,
23 #[serde(rename = "time_in_nanos")]
24 pub time_in_nanos: String,
25 #[serde(rename = "children", default, skip_serializing_if = "Option::is_none")]
26 pub children: Option<Vec<core::search::QueryProfile>>,
27 #[serde(rename = "type")]
28 pub r#type: String,
29}
30
31impl QueryProfile {
32
33 pub fn new(breakdown: core::search::QueryBreakdown, description: String, time_in_nanos: String, r#type: String) -> QueryProfile {
34 QueryProfile {
35 breakdown,
36 description,
37 time_in_nanos,
38 children: None,
39 r#type,
40 }
41 }
42}