pub struct PrometheusConfigBuilder { /* private fields */ }Expand description
A builder to create an instance of PrometheusConfig.
Implementations§
Source§impl PrometheusConfigBuilder
impl PrometheusConfigBuilder
Sourcepub fn listen(&mut self, val: Listen) -> &mut Self
pub fn listen(&mut self, val: Listen) -> &mut Self
Provide a value for listen.
If no value is provided for listen, build will use Default::default().
§listen
Port on which to establish a Prometheus scrape endpoint
We listen here for incoming HTTP connections.
If just a port is provided, we don’t support IPv6. Alternatively, (only) a single address and port can be specified. These restrictions are due to upstream limitations: https://github.com/metrics-rs/metrics/issues/567.
Source§impl PrometheusConfigBuilder
impl PrometheusConfigBuilder
Sourcepub fn build(&self) -> Result<PrometheusConfig, ConfigBuildError>
pub fn build(&self) -> Result<PrometheusConfig, ConfigBuildError>
Try to construct a new PrometheusConfig from the fields set in this builder.
Return an error if any required field is missing, or is set to something invalid.
Trait Implementations§
Source§impl Builder for PrometheusConfigBuilder
impl Builder for PrometheusConfigBuilder
Source§type Built = PrometheusConfig
type Built = PrometheusConfig
The type that this builder constructs. Read more
Source§fn build(&self) -> Result<PrometheusConfig, ConfigBuildError>
fn build(&self) -> Result<PrometheusConfig, ConfigBuildError>
Build into a
Built Read moreSource§impl Clone for PrometheusConfigBuilder
impl Clone for PrometheusConfigBuilder
Source§fn clone(&self) -> PrometheusConfigBuilder
fn clone(&self) -> PrometheusConfigBuilder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl ConfigBuilder for PrometheusConfigBuilder
impl ConfigBuilder for PrometheusConfigBuilder
Source§fn apply_defaults(&mut self) -> Result<(), ConfigBuildError>
fn apply_defaults(&mut self) -> Result<(), ConfigBuildError>
Modify
self by replacing any options that haven’t been set with their defaults. Read moreSource§impl Debug for PrometheusConfigBuilder
impl Debug for PrometheusConfigBuilder
Source§impl Default for PrometheusConfigBuilder
impl Default for PrometheusConfigBuilder
Source§fn default() -> PrometheusConfigBuilder
fn default() -> PrometheusConfigBuilder
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PrometheusConfigBuilder
impl<'de> Deserialize<'de> for PrometheusConfigBuilder
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl ExtendBuilder for PrometheusConfigBuilder
impl ExtendBuilder for PrometheusConfigBuilder
Source§fn extend_from(&mut self, other: Self, strategy: ExtendStrategy)
fn extend_from(&mut self, other: Self, strategy: ExtendStrategy)
Auto Trait Implementations§
impl Freeze for PrometheusConfigBuilder
impl RefUnwindSafe for PrometheusConfigBuilder
impl Send for PrometheusConfigBuilder
impl Sync for PrometheusConfigBuilder
impl Unpin for PrometheusConfigBuilder
impl UnsafeUnpin for PrometheusConfigBuilder
impl UnwindSafe for PrometheusConfigBuilder
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more