Struct lexa_framework::DefaultApplication
source · pub struct DefaultApplication<UserEnv, UserCLI, UserState> {
pub server: Server<UserState>,
/* private fields */
}
Fields§
§server: Server<UserState>
Serveur
Implementations§
source§impl<UE, UC, US> DefaultApplication<UE, UC, US>where
UE: 'static + ApplicationEnvInterface,
UC: 'static + ApplicationCLIInterface,
US: 'static + StateInterface,
impl<UE, UC, US> DefaultApplication<UE, UC, US>where UE: 'static + ApplicationEnvInterface, UC: 'static + ApplicationCLIInterface, US: 'static + StateInterface,
sourcepub async fn create(
name: &'static str,
version: &'static str,
root_dir: impl AsRef<Path>,
loader_extension: impl Into<SettingsLoaderExtension>
) -> Result<Self, Error>
pub async fn create( name: &'static str, version: &'static str, root_dir: impl AsRef<Path>, loader_extension: impl Into<SettingsLoaderExtension> ) -> Result<Self, Error>
Crée l’application par défaut.
pub fn routes(&self) -> impl Iterator<Item = &Route<US>>
pub fn state(&self) -> State<US>
pub async fn run(self) -> Result<(), Error>
Trait Implementations§
source§impl<UE, UC, US> ApplicationExt for DefaultApplication<UE, UC, US>where
UE: ApplicationEnvInterface,
UC: ApplicationCLIInterface,
impl<UE, UC, US> ApplicationExt for DefaultApplication<UE, UC, US>where UE: ApplicationEnvInterface, UC: ApplicationCLIInterface,
source§fn define_process_mode(self, mode: EnvProcessMode) -> Selfwhere
Self: Sized,
fn define_process_mode(self, mode: EnvProcessMode) -> Selfwhere Self: Sized,
Définit le mode d’exécution du programme.
type CLI = UC
type ENV = UE
source§fn with_cli_args(self) -> Self
fn with_cli_args(self) -> Self
Définit les arguments de la CLI, filtrés par les champs de la structure
implémentant l’interface [CLI_Interface].
source§fn with_env_vars(self) -> Result<Self, Error>
fn with_env_vars(self) -> Result<Self, Error>
Définit les variables d’environnement, filtrés par les champs de la
structure implémentant l’interface [ENV_Interface].
Auto Trait Implementations§
impl<UserEnv, UserCLI, UserState> !RefUnwindSafe for DefaultApplication<UserEnv, UserCLI, UserState>
impl<UserEnv, UserCLI, UserState> Send for DefaultApplication<UserEnv, UserCLI, UserState>where UserCLI: Send, UserEnv: Send, UserState: Send,
impl<UserEnv, UserCLI, UserState> !Sync for DefaultApplication<UserEnv, UserCLI, UserState>
impl<UserEnv, UserCLI, UserState> Unpin for DefaultApplication<UserEnv, UserCLI, UserState>where UserCLI: Unpin, UserEnv: Unpin, UserState: Unpin,
impl<UserEnv, UserCLI, UserState> !UnwindSafe for DefaultApplication<UserEnv, UserCLI, UserState>
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