pub struct DashboardServer { /* private fields */ }Expand description
Dashboard web server
Implementations§
Source§impl DashboardServer
impl DashboardServer
Sourcepub fn new(cost_tracker: Arc<CostTracker>) -> Self
pub fn new(cost_tracker: Arc<CostTracker>) -> Self
Create a new dashboard server with Prometheus metrics
Sourcepub fn state(&self) -> Arc<DashboardState>
pub fn state(&self) -> Arc<DashboardState>
Get the dashboard state for external updates
Sourcepub async fn run(self, addr: &str) -> Result<(), Box<dyn Error + Send + Sync>>
pub async fn run(self, addr: &str) -> Result<(), Box<dyn Error + Send + Sync>>
Run the dashboard server
Sourcepub fn spawn(self, addr: String) -> JoinHandle<()>
pub fn spawn(self, addr: String) -> JoinHandle<()>
Run the dashboard server in a background task
Auto Trait Implementations§
impl Freeze for DashboardServer
impl !RefUnwindSafe for DashboardServer
impl Send for DashboardServer
impl Sync for DashboardServer
impl Unpin for DashboardServer
impl UnsafeUnpin for DashboardServer
impl !UnwindSafe for DashboardServer
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