Skip to main content

rumtk_web_register_app_context

Macro rumtk_web_register_app_context 

Source
macro_rules! rumtk_web_register_app_context {
    (  ) => { ... };
    (
        $app_components:expr
    ) => { ... };
    (
        $app_components:expr,
        $app_switches:expr $(,)?
    ) => { ... };
    (
        $app_components:expr,
        $app_switches:expr,
        $port:expr
    ) => { ... };
    (
        $app_components:expr,
        $app_switches:expr,
        $port:expr,
        $hook:expr
    ) => { ... };
}
Expand description

Initializes a Context structure used for runtime configuration of the app in addition to the JSON configuration.

§Usage Examples

use rumtk_web::{rumtk_web_register_app_context, rumtk_web_register_app_switches};
use rumtk_web::utils::app::{AppComponents, AppSwitches};

rumtk_web_register_app_context!();
rumtk_web_register_app_context!(AppComponents::default());
rumtk_web_register_app_context!(AppComponents::default(), AppSwitches::default());
rumtk_web_register_app_context!(AppComponents::default(), AppSwitches::default(), 3001);
rumtk_web_register_app_context!(AppComponents::default(), AppSwitches::default(), 3001, async || Ok(()));

§Usage Signature

Below are the supported macro signatures:

    - ()
    - ( app_components )
    - ( app_components, app_switches )
    - ( app_components, app_switches, port )
    - ( app_components, app_switches, port, || -> rumtk_core::base::RUMResult<()> { Ok(()) } )

§Note

In some cases, this struct is used to override the typical behavior since the ip, port, and logic fields are initialized only once. Meaning, we can route the system to use specific ports during testing or statically in the program and follow the CLI arguments all other times.