You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
444 B
23 lines
444 B
pub const APP_NAME: &str = env!("CARGO_PKG_NAME"); |
|
pub const APP_VERSION: &str = env!("CARGO_PKG_VERSION"); |
|
|
|
#[derive(Clone)] |
|
pub struct AppState { |
|
pub name: String, |
|
pub version: String, |
|
} |
|
|
|
impl AppState { |
|
pub fn new() -> Self { |
|
Self { |
|
name: APP_NAME.to_string(), |
|
version: APP_VERSION.to_string(), |
|
} |
|
} |
|
} |
|
|
|
impl Default for AppState { |
|
fn default() -> Self { |
|
Self::new() |
|
} |
|
}
|
|
|