[−][src]Struct appinsights::TelemetryContext
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()));
Methods
impl TelemetryContext
[src]
pub fn from_config(config: &TelemetryConfig) -> Self
[src]
Creates a new instance of telemetry context from config
pub fn new(i_key: String, tags: ContextTags, properties: Properties) -> Self
[src]
Creates a new instance of telemetry context.
pub fn properties_mut(&mut self) -> &mut Properties
[src]
Returns mutable reference to a collection of common properties to attach to telemetry event.
pub fn properties(&self) -> &Properties
[src]
Returns immutable reference to a collection of common properties to attach to telemetry event.
pub fn tags_mut(&mut self) -> &mut ContextTags
[src]
Returns mutable reference to a collection of common tags to attach to telemetry event.
pub fn tags(&self) -> &ContextTags
[src]
Returns immutable reference to a collection of common tags to attach to telemetry event.
Trait Implementations
impl Clone for TelemetryContext
[src]
fn clone(&self) -> TelemetryContext
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Auto Trait Implementations
impl RefUnwindSafe for TelemetryContext
impl Send for TelemetryContext
impl Sync for TelemetryContext
impl Unpin for TelemetryContext
impl UnwindSafe for TelemetryContext
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,