Struct 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,

Source

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.

Source

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

Source

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

Source

pub async fn run(self) -> Result<(), ApplicationError>

Trait Implementations§

Source§

impl<UE, UC, US> ApplicationCreateExt for DefaultApplication<UE, UC, US>

Source§

fn define_process_mode(self, mode: EnvProcessMode) -> Self
where Self: Sized,

Définit le mode d’exécution du programme.

Source§

type CLI = UC

Source§

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, ApplicationError>

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> Freeze for DefaultApplication<UserEnv, UserCLI, UserState>
where UserEnv: Freeze, UserCLI: Freeze, UserState: Freeze,

§

impl<UserEnv, UserCLI, UserState> !RefUnwindSafe for DefaultApplication<UserEnv, UserCLI, UserState>

§

impl<UserEnv, UserCLI, UserState> Send for DefaultApplication<UserEnv, UserCLI, UserState>
where UserEnv: Send, UserCLI: Send, UserState: Send,

§

impl<UserEnv, UserCLI, UserState> !Sync for DefaultApplication<UserEnv, UserCLI, UserState>

§

impl<UserEnv, UserCLI, UserState> Unpin for DefaultApplication<UserEnv, UserCLI, UserState>
where UserEnv: Unpin, UserCLI: Unpin, UserState: Unpin,

§

impl<UserEnv, UserCLI, UserState> !UnwindSafe for DefaultApplication<UserEnv, UserCLI, UserState>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

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 T
where U: TryFrom<T>,

Source§

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
Source§

impl<T> ErasedDestructor for T
where T: 'static,