#[non_exhaustive]pub struct SubmitMetricsOptionalParams {
pub content_encoding: Option<MetricContentEncoding>,
}
Expand description
SubmitMetricsOptionalParams is a struct for passing parameters to the method MetricsAPI::submit_metrics
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.content_encoding: Option<MetricContentEncoding>
HTTP header used to compress the media-type.
Implementations§
Source§impl SubmitMetricsOptionalParams
impl SubmitMetricsOptionalParams
Sourcepub fn content_encoding(self, value: MetricContentEncoding) -> Self
pub fn content_encoding(self, value: MetricContentEncoding) -> Self
HTTP header used to compress the media-type.
Examples found in repository?
examples/v1_metrics_SubmitMetrics_2203981258.rs (line 22)
10async fn main() {
11 let body = MetricsPayload::new(vec![Series::new(
12 "system.load.1".to_string(),
13 vec![vec![Some(1636629071.0 as f64), Some(1.1 as f64)]],
14 )
15 .tags(vec!["test:ExampleMetric".to_string()])
16 .type_("gauge".to_string())]);
17 let configuration = datadog::Configuration::new();
18 let api = MetricsAPI::with_config(configuration);
19 let resp = api
20 .submit_metrics(
21 body,
22 SubmitMetricsOptionalParams::default().content_encoding(MetricContentEncoding::DEFLATE),
23 )
24 .await;
25 if let Ok(value) = resp {
26 println!("{:#?}", value);
27 } else {
28 println!("{:#?}", resp.unwrap_err());
29 }
30}
Trait Implementations§
Source§impl Clone for SubmitMetricsOptionalParams
impl Clone for SubmitMetricsOptionalParams
Source§fn clone(&self) -> SubmitMetricsOptionalParams
fn clone(&self) -> SubmitMetricsOptionalParams
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for SubmitMetricsOptionalParams
impl Debug for SubmitMetricsOptionalParams
Source§impl Default for SubmitMetricsOptionalParams
impl Default for SubmitMetricsOptionalParams
Source§fn default() -> SubmitMetricsOptionalParams
fn default() -> SubmitMetricsOptionalParams
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for SubmitMetricsOptionalParams
impl RefUnwindSafe for SubmitMetricsOptionalParams
impl Send for SubmitMetricsOptionalParams
impl Sync for SubmitMetricsOptionalParams
impl Unpin for SubmitMetricsOptionalParams
impl UnwindSafe for SubmitMetricsOptionalParams
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more