29 lines
474 B
Rust
29 lines
474 B
Rust
use std::sync::Arc;
|
|
|
|
use chrono::{DateTime, Utc};
|
|
|
|
use crate::routes::AppState;
|
|
|
|
pub struct AppStateWithHealth {
|
|
pub app_state: Arc<AppState>,
|
|
pub health_state: Arc<HealthState>,
|
|
}
|
|
|
|
pub struct HealthState {
|
|
start_at: DateTime<Utc>,
|
|
}
|
|
|
|
impl Default for HealthState {
|
|
fn default() -> Self {
|
|
Self {
|
|
start_at: Utc::now(),
|
|
}
|
|
}
|
|
}
|
|
|
|
impl HealthState {
|
|
pub fn get_start_at(&self) -> &DateTime<Utc> {
|
|
&self.start_at
|
|
}
|
|
}
|