pub struct ApplicationBuilder { /* private fields */ }Implementations§
Source§impl ApplicationBuilder
impl ApplicationBuilder
pub fn get_fusion_config(&self) -> Arc<FusionSetting> ⓘ
pub fn with_config_registry( &mut self, config_registry: FusionConfigRegistry, ) -> &Self
Sourcepub fn add_config_source<T>(&mut self, source: T) -> &mut Self
pub fn add_config_source<T>(&mut self, source: T) -> &mut Self
add Config Source
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 contains_plugin<T: Plugin>(&self) -> bool
pub fn contains_plugin<T: Plugin>(&self) -> bool
Returns true if the Plugin has already been added.
Sourcepub fn add_component<T>(&mut self, component: T) -> &mut Self
pub fn add_component<T>(&mut self, component: T) -> &mut Self
Add component to the registry
Sourcepub fn get_component_ref<T>(&self) -> ComponentResult<ComponentArc<T>>
pub fn get_component_ref<T>(&self) -> ComponentResult<ComponentArc<T>>
Get the component of the specified type
pub fn component<T>(&self) -> T
Sourcepub fn get_component<T>(&self) -> ComponentResult<T>
pub fn get_component<T>(&self) -> ComponentResult<T>
get cloned component
Sourcepub fn add_shutdown_hook<T>(&mut self, hook: T) -> &mut Self
pub fn add_shutdown_hook<T>(&mut self, hook: T) -> &mut Self
Add a shutdown hook
Sourcepub async fn run(&mut self) -> Result<Application>
pub async fn run(&mut self) -> Result<Application>
The run method is suitable for applications that contain scheduling logic,
such as web, job, and stream.
Sourcepub async fn build(&mut self) -> Result<Application>
pub async fn build(&mut self) -> Result<Application>
Unlike the [run] method, the build method is suitable for applications that do not contain scheduling logic.
This method returns the built Application, and developers can implement logic such as command lines and task scheduling by themselves.
Trait Implementations§
Source§impl ConfigRegistry for ApplicationBuilder
impl ConfigRegistry for ApplicationBuilder
Source§fn get_config<T>(&self) -> ConfigureResult<T>where
T: DeserializeOwned + Configurable,
fn get_config<T>(&self) -> ConfigureResult<T>where
T: DeserializeOwned + Configurable,
Get the configuration items according to the Configurable’s
config_prefixfn get_config_by_path<T>(&self, path: &str) -> ConfigureResult<T>where
T: DeserializeOwned,
Source§impl Default for ApplicationBuilder
impl Default for ApplicationBuilder
impl Send for ApplicationBuilder
impl Sync for ApplicationBuilder
Auto Trait Implementations§
impl !RefUnwindSafe for ApplicationBuilder
impl !UnwindSafe for ApplicationBuilder
impl Freeze for ApplicationBuilder
impl Unpin for ApplicationBuilder
impl UnsafeUnpin for ApplicationBuilder
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