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, ApplicationError>
pub async fn create( name: &'static str, version: &'static str, root_dir: impl AsRef<Path>, loader_extension: impl Into<SettingsLoaderExtension>, ) -> Result<Self, ApplicationError>
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<(), ApplicationError>
Trait Implementations§
Source§impl<UE, UC, US> ApplicationCreateExt for DefaultApplication<UE, UC, US>where
UE: ApplicationEnvInterface,
UC: ApplicationCLIInterface,
impl<UE, UC, US> ApplicationCreateExt 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, ApplicationError>
fn with_env_vars(self) -> Result<Self, ApplicationError>
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> Freeze for DefaultApplication<UserEnv, UserCLI, UserState>
impl<UserEnv, UserCLI, UserState> !RefUnwindSafe for DefaultApplication<UserEnv, UserCLI, UserState>
impl<UserEnv, UserCLI, UserState> Send for DefaultApplication<UserEnv, UserCLI, UserState>
impl<UserEnv, UserCLI, UserState> !Sync for DefaultApplication<UserEnv, UserCLI, UserState>
impl<UserEnv, UserCLI, UserState> Unpin for DefaultApplication<UserEnv, UserCLI, UserState>
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more