pub struct ApplicationBuilder { /* private fields */ }Expand description
Builder for creating Application instances
This builder provides a fluent API for configuring and building applications with their modules and dependencies.
Implementations§
Source§impl ApplicationBuilder
impl ApplicationBuilder
Sourcepub fn with_module<M: Module + 'static>(self, module: M) -> Self
pub fn with_module<M: Module + 'static>(self, module: M) -> Self
Sourcepub fn with_service<T: 'static + Send + Sync>(self, service: T) -> Self
pub fn with_service<T: 'static + Send + Sync>(self, service: T) -> Self
Sourcepub fn with_service_arc<T: 'static + Send + Sync>(self, service: Arc<T>) -> Self
pub fn with_service_arc<T: 'static + Send + Sync>(self, service: Arc<T>) -> Self
Sourcepub async fn build(self) -> ModuleResult<Application>
pub async fn build(self) -> ModuleResult<Application>
Builds the application
This method:
- Configures services for all modules
- Initializes all modules
- Configures routes from all modules
§Returns
A Result containing the built application
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ApplicationBuilder
impl !UnwindSafe for ApplicationBuilder
impl Freeze for ApplicationBuilder
impl Send for ApplicationBuilder
impl Sync 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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more