pub struct ManagementHandler { /* private fields */ }Expand description
Management API handler
Implementations§
Source§impl ManagementHandler
impl ManagementHandler
Sourcepub fn new(config: ManagementConfig, stats: StatsCollector) -> Self
pub fn new(config: ManagementConfig, stats: StatsCollector) -> Self
Create a new management handler
Sourcepub fn with_config(config: ManagementConfig) -> Self
pub fn with_config(config: ManagementConfig) -> Self
Create a new management handler with default stats collector
Sourcepub fn stats(&self) -> &StatsCollector
pub fn stats(&self) -> &StatsCollector
Get the stats collector
Sourcepub fn stats_collector(&self) -> StatsCollector
pub fn stats_collector(&self) -> StatsCollector
Get a clone of the stats collector
Sourcepub fn is_management_path(&self, path: &str) -> bool
pub fn is_management_path(&self, path: &str) -> bool
Check if a path matches a management endpoint
Sourcepub fn handle_request(
&self,
req: &Request<Incoming>,
) -> Option<Response<Full<Bytes>>>
pub fn handle_request( &self, req: &Request<Incoming>, ) -> Option<Response<Full<Bytes>>>
Handle a management API request
Sourcepub fn handle_health(&self) -> Response<Full<Bytes>>
pub fn handle_health(&self) -> Response<Full<Bytes>>
Handle health check request GET /health -> 200 OK {“status”:“healthy”}
Sourcepub fn handle_ready(&self) -> Response<Full<Bytes>>
pub fn handle_ready(&self) -> Response<Full<Bytes>>
Handle readiness check request GET /ready -> 200 OK {“status”:“ready”} or 503 {“status”:“not_ready”}
Sourcepub fn handle_stats(&self) -> Response<Full<Bytes>>
pub fn handle_stats(&self) -> Response<Full<Bytes>>
Handle stats request GET /stats -> JSON statistics
Sourcepub fn health_path(&self) -> &str
pub fn health_path(&self) -> &str
Get the health path
Sourcepub fn ready_path(&self) -> &str
pub fn ready_path(&self) -> &str
Get the ready path
Sourcepub fn stats_path(&self) -> &str
pub fn stats_path(&self) -> &str
Get the stats path
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Check if management API is enabled
Trait Implementations§
Source§impl Clone for ManagementHandler
impl Clone for ManagementHandler
Source§fn clone(&self) -> ManagementHandler
fn clone(&self) -> ManagementHandler
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ManagementHandler
impl RefUnwindSafe for ManagementHandler
impl Send for ManagementHandler
impl Sync for ManagementHandler
impl Unpin for ManagementHandler
impl UnsafeUnpin for ManagementHandler
impl UnwindSafe for ManagementHandler
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