pub struct FeatureDetector { /* private fields */ }Expand description
Detects workload features.
The feature detector is used to determine which features are present in the workload, such as if the application is running in a Kubernetes environment or directly on Docker. This information is used to drive the collection of workload metadata that powers entity tagging.
FeatureDetector can be used in an automatic detection mode, where it will attempt to detect all features that are
present, or it can be used to assert that a specific feature is present for scenarios where the feature is required,
and the workload is already known upfront.
Implementations§
Source§impl FeatureDetector
impl FeatureDetector
Sourcepub fn automatic(containerd_socket_path: Option<PathBuf>) -> Self
pub fn automatic(containerd_socket_path: Option<PathBuf>) -> Self
Creates a new FeatureDetector that checks for all possible features.
If containerd_socket_path is given, that path is used for containerd detection. Otherwise, well-known paths
are probed.
Sourcepub fn for_feature(
containerd_socket_path: Option<PathBuf>,
feature_mask: Feature,
) -> Self
pub fn for_feature( containerd_socket_path: Option<PathBuf>, feature_mask: Feature, ) -> Self
Creates a new FeatureDetector that checks for the given features.
Multiple features can be checked for by combining the feature variants in a bitwise OR fashion.
If containerd_socket_path is given, that path is used for containerd detection. Otherwise, well-known paths
are probed.
Sourcepub fn is_feature_available(&self, feature: Feature) -> bool
pub fn is_feature_available(&self, feature: Feature) -> bool
Checks if the given feature was detected and is available.
Trait Implementations§
Source§impl Clone for FeatureDetector
impl Clone for FeatureDetector
Source§fn clone(&self) -> FeatureDetector
fn clone(&self) -> FeatureDetector
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for FeatureDetector
impl RefUnwindSafe for FeatureDetector
impl Send for FeatureDetector
impl Sync for FeatureDetector
impl Unpin for FeatureDetector
impl UnwindSafe for FeatureDetector
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> Track for T
impl<T> Track for T
§fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
Tracked wrapper. Read more§fn in_current_resource_group(self) -> Tracked<Self>
fn in_current_resource_group(self) -> Tracked<Self>
Tracked wrapper. Read more