Struct spring_boot::app::AppBuilder
source · pub struct AppBuilder { /* private fields */ }
Implementations§
source§impl AppBuilder
impl AppBuilder
sourcepub fn add_plugin<T: Plugin>(&mut self, plugin: T) -> &mut Self
pub fn add_plugin<T: Plugin>(&mut self, plugin: T) -> &mut Self
add plugin
sourcepub fn is_plugin_added<T: Plugin>(&self) -> bool
pub fn is_plugin_added<T: Plugin>(&self) -> bool
Returns true
if the Plugin
has already been added.
sourcepub fn config_file(&mut self, config_path: &str) -> &mut Self
pub fn config_file(&mut self, config_path: &str) -> &mut Self
The path of the configuration file, default is ./config/app.toml
.
The application automatically reads the environment configuration file
in the same directory according to the spring_ENV
environment variable,
such as ./config/app-dev.toml
.
The environment configuration file has a higher priority and will
overwrite the configuration items of the main configuration file.
For specific supported environments, see the Env enum.
sourcepub fn get_config<T>(&self, plugin: &impl Plugin) -> Result<T>where
T: DeserializeOwned,
pub fn get_config<T>(&self, plugin: &impl Plugin) -> Result<T>where
T: DeserializeOwned,
Get the configuration items of the plugin according to the plugin’s config_prefix
sourcepub fn add_component<T>(&mut self, component: T) -> &mut Self
pub fn add_component<T>(&mut self, component: T) -> &mut Self
sourcepub fn add_scheduler<T>(&mut self, scheduler: T) -> &mut Self
pub fn add_scheduler<T>(&mut self, scheduler: T) -> &mut Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AppBuilder
impl !RefUnwindSafe for AppBuilder
impl Unpin for AppBuilder
impl !UnwindSafe for AppBuilder
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