pub struct PrometheusService { /* private fields */ }Implementations§
Source§impl PrometheusService
impl PrometheusService
pub fn new(addr: SocketAddr) -> Self
Sourcepub fn port(&self) -> u16
pub fn port(&self) -> u16
Returns the actual port the server is listening on (after start())
Returns 0 if the service hasn’t been started yet.
Sourcepub fn port_accessor(&self) -> Arc<AtomicU16>
pub fn port_accessor(&self) -> Arc<AtomicU16>
Returns a cloneable accessor for the bound port.
Use this when you need to read the port after the service has been moved into a CamelContext or other container.
pub fn status_arc(&self) -> Arc<AtomicU8>
pub fn set_health_source(&mut self, source: Arc<dyn HealthSource>)
pub fn health_source(&self) -> Option<Arc<dyn HealthSource>>
Trait Implementations§
Source§impl Lifecycle for PrometheusService
impl Lifecycle for PrometheusService
Source§fn as_metrics_collector(&self) -> Option<Arc<dyn MetricsCollector>>
fn as_metrics_collector(&self) -> Option<Arc<dyn MetricsCollector>>
Optional: expose MetricsCollector for auto-registration
Source§fn status(&self) -> ServiceStatus
fn status(&self) -> ServiceStatus
Current status of the service.
Source§fn start<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Start service (called during CamelContext.start())
Source§fn stop<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stop<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), CamelError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stop service (called during CamelContext.stop())
fn as_function_invoker(&self) -> Option<Arc<dyn FunctionInvoker>>
Auto Trait Implementations§
impl !Freeze for PrometheusService
impl !RefUnwindSafe for PrometheusService
impl !UnwindSafe for PrometheusService
impl Send for PrometheusService
impl Sync for PrometheusService
impl Unpin for PrometheusService
impl UnsafeUnpin for PrometheusService
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