Skip to main content

ApplicationBuilder

Struct ApplicationBuilder 

Source
pub struct ApplicationBuilder { /* private fields */ }

Implementations§

Source§

impl ApplicationBuilder

Source

pub fn get_fusion_config(&self) -> Arc<FusionSetting> ⓘ

Source

pub fn with_config_registry( &mut self, config_registry: FusionConfigRegistry, ) -> &Self

Source

pub fn add_config_source<T>(&mut self, source: T) -> &mut Self
where T: Source + Send + Sync + 'static,

add Config Source

Source

pub fn add_plugin<T: Plugin>(&mut self, plugin: T) -> &mut Self

add plugin

Source

pub fn contains_plugin<T: Plugin>(&self) -> bool

Returns true if the Plugin has already been added.

Source

pub fn add_component<T>(&mut self, component: T) -> &mut Self
where T: Clone + Any + Send + Sync,

Add component to the registry

Source

pub fn get_component_ref<T>(&self) -> ComponentResult<ComponentArc<T>>
where T: Any + Send + Sync,

Get the component of the specified type

Source

pub fn component<T>(&self) -> T
where T: Clone + Send + Sync + 'static,

Source

pub fn get_component<T>(&self) -> ComponentResult<T>
where T: Clone + Send + Sync + 'static,

get cloned component

Source

pub fn add_shutdown_hook<T>(&mut self, hook: T) -> &mut Self
where T: FnOnce(Application) -> Box<dyn Future<Output = Result<String>> + Send> + 'static,

Add a shutdown hook

Source

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.

Source

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

Source§

fn get_config<T>(&self) -> ConfigureResult<T>

Get the configuration items according to the Configurable’s config_prefix
Source§

fn get_config_by_path<T>(&self, path: &str) -> ConfigureResult<T>

Source§

impl Default for ApplicationBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Send for ApplicationBuilder

Source§

impl Sync for ApplicationBuilder

Auto Trait Implementations§

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> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self> ⓘ

Attaches the current Context to this type, returning a WithContext 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> 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 = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V