Struct appinsights::TelemetryContext[][src]

pub struct TelemetryContext { /* fields omitted */ }
Expand description

Encapsulates contextual data common to all telemetry submitted through a telemetry client.

Examples

use appinsights::telemetry::{ContextTags, Properties};
use appinsights::TelemetryContext;

let mut properties = Properties::default();
properties.insert("Resource Group".to_string(), "my-rg".to_string());

let mut tags = ContextTags::default();
tags.insert("account_id".to_string(), "123-345-777".to_string());

let context = TelemetryContext::new("instrumentation".to_string(), tags, properties);

assert_eq!(context.properties().get("Resource Group"), Some(&"my-rg".to_string()));
assert_eq!(context.tags().get("account_id"), Some(&"123-345-777".to_string()));

Implementations

Creates a new instance of telemetry context from config

Creates a new instance of telemetry context.

Returns mutable reference to a collection of common properties to attach to telemetry event.

Returns immutable reference to a collection of common properties to attach to telemetry event.

Returns mutable reference to a collection of common tags to attach to telemetry event.

Returns immutable reference to a collection of common tags to attach to telemetry event.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.