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,

source

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.

source

pub fn routes(&self) -> impl Iterator<Item = &Route<US>>

source

pub fn state(&self) -> State<US>

source

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,

source§

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

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>

Définit les variables d’environnement, filtrés par les champs de la structure implémentant l’interface [ENV_Interface].
source§

fn cli_args(&self) -> &Self::CLI

Arguments de la CLI.
source§

fn env_vars(&self) -> &Self::ENV

Variables d’environnement.

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> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more