Skip to main content

libdd_crashtracker/crash_info/
experimental.rs

1// Copyright 2025-Present Datadog, Inc. https://www.datadoghq.com/
2// SPDX-License-Identifier: Apache-2.0
3use crate::runtime_callback::RuntimeStack;
4use schemars::JsonSchema;
5use serde::{Deserialize, Serialize};
6
7use super::unknown_value::UnknownValue;
8
9#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize, JsonSchema)]
10pub struct Experimental {
11    #[serde(default, skip_serializing_if = "Vec::is_empty")]
12    pub additional_tags: Vec<String>,
13    #[serde(default, skip_serializing_if = "Option::is_none")]
14    pub runtime_stack: Option<RuntimeStack>,
15}
16
17impl Experimental {
18    pub fn new() -> Self {
19        Self::default()
20    }
21
22    pub fn with_additional_tags(mut self, additional_tags: Vec<String>) -> Self {
23        self.additional_tags = additional_tags;
24        self
25    }
26
27    pub fn with_runtime_stack(mut self, runtime_stack: RuntimeStack) -> Self {
28        self.runtime_stack = Some(runtime_stack);
29        self
30    }
31}
32
33impl UnknownValue for Experimental {
34    fn unknown_value() -> Self {
35        Self {
36            additional_tags: vec![],
37            runtime_stack: None,
38        }
39    }
40}