Pour tout problème contactez-nous par mail : support@froggit.fr | La FAQ :grey_question: | Rejoignez-nous sur le Chat :speech_balloon:

Skip to content
Snippets Groups Projects
state.rs 402 B
Newer Older
peterrabbit's avatar
peterrabbit committed
use crate::app::{AppArgs, AppConfig, AppPreferences};
use structopt::StructOpt;
peterrabbit's avatar
peterrabbit committed

#[derive(Clone)]
pub struct AppState {
    pub config: AppConfig,
    pub preferences: AppPreferences,
    // authentication
    // ...
}

impl AppState {
    pub fn new() -> Self {
        AppState {
peterrabbit's avatar
peterrabbit committed
            config: AppConfig::new(AppArgs::from_args()),
peterrabbit's avatar
peterrabbit committed
            preferences: AppPreferences {},
        }
    }
}