Trait Application

Source
pub trait Application: Send + Sync {
    // Required methods
    fn init_middleware<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        properties: &'life1 ApplicationProperties,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn application_router<'life0, 'life1, 'async_trait>(
        &'life0 mut self,
        ctx: &'life1 mut ApplicationContext,
    ) -> Pin<Box<dyn Future<Output = (OpenRouter, PrivateRouter)> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

    // Provided methods
    fn banner_show() { ... }
    fn init_message_source<'life0, 'life1, 'async_trait, T>(
        &'life0 mut self,
        application_properties: &'life1 NextProperties,
    ) -> Pin<Box<dyn Future<Output = HashMap<String, HashMap<String, String>>> + Send + 'async_trait>>
       where T: 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait { ... }
    fn user_permission_resource(&self) -> Option<UserPermissionResource> { ... }
    fn init_logger(&self, application_properties: &ApplicationProperties) { ... }
    fn autowire_properties<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 mut self,
        ctx: &'life1 mut ApplicationContext,
        application_properties: &'life2 ApplicationProperties,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn register_singleton<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        ctx: &'life1 mut ApplicationContext,
        application_properties: &'life2 ApplicationProperties,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn init_infrastructure<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        ctx: &'life1 mut ApplicationContext,
        _application_properties: &'life2 ApplicationProperties,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn bind_tcp_server<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 mut self,
        ctx: &'life1 mut ApplicationContext,
        application_properties: &'life2 ApplicationProperties,
        time: Instant,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
    fn run<'async_trait>(    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: Application + Default + 'async_trait { ... }
}

Required Methods§

Source

fn init_middleware<'life0, 'life1, 'async_trait>( &'life0 mut self, properties: &'life1 ApplicationProperties, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

initialize the middleware.

Source

fn application_router<'life0, 'life1, 'async_trait>( &'life0 mut self, ctx: &'life1 mut ApplicationContext, ) -> Pin<Box<dyn Future<Output = (OpenRouter, PrivateRouter)> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Provided Methods§

Source

fn banner_show()

show the banner of the application.

Source

fn init_message_source<'life0, 'life1, 'async_trait, T>( &'life0 mut self, application_properties: &'life1 NextProperties, ) -> Pin<Box<dyn Future<Output = HashMap<String, HashMap<String, String>>> + Send + 'async_trait>>
where T: 'async_trait, Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

initialize the message source.

Source

fn user_permission_resource(&self) -> Option<UserPermissionResource>

Source

fn init_logger(&self, application_properties: &ApplicationProperties)

initialize the logger.

Source

fn autowire_properties<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, ctx: &'life1 mut ApplicationContext, application_properties: &'life2 ApplicationProperties, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Autowire properties

Source

fn register_singleton<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 mut ApplicationContext, application_properties: &'life2 ApplicationProperties, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Register application singleton

Source

fn init_infrastructure<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, ctx: &'life1 mut ApplicationContext, _application_properties: &'life2 ApplicationProperties, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

initialize the application infrastructure

Source

fn bind_tcp_server<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, ctx: &'life1 mut ApplicationContext, application_properties: &'life2 ApplicationProperties, time: Instant, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

bind tcp server.

Source

fn run<'async_trait>() -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: Application + Default + 'async_trait,

run the application.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§