pub struct TestApplicationBuilder { /* private fields */ }Expand description
Builds an in-process HTTP application with test-local provider overrides.
Implementations§
Source§impl TestApplicationBuilder
impl TestApplicationBuilder
Sourcepub fn override_provider(self, provider: ProviderDefinition) -> Self
pub fn override_provider(self, provider: ProviderDefinition) -> Self
Replaces a provider with a complete definition using the same concrete key.
Sourcepub fn override_value<T: Send + Sync + 'static>(self, value: T) -> Self
pub fn override_value<T: Send + Sync + 'static>(self, value: T) -> Self
Replaces provider T with a singleton test value.
Sourcepub fn override_factory<T, F, Fut>(
self,
scope: Scope,
dependencies: Vec<Dependency>,
factory: F,
) -> Self
pub fn override_factory<T, F, Fut>( self, scope: Scope, dependencies: Vec<Dependency>, factory: F, ) -> Self
Replaces provider T with an asynchronous test factory.
Sourcepub async fn build(self) -> Result<TestApplication, ApplicationError>
pub async fn build(self) -> Result<TestApplication, ApplicationError>
Compiles and initializes the in-process test application.
§Errors
Returns ApplicationError when the graph, overrides, eager providers, routes, or
lifecycle hooks fail.
Auto Trait Implementations§
impl !RefUnwindSafe for TestApplicationBuilder
impl !UnwindSafe for TestApplicationBuilder
impl Freeze for TestApplicationBuilder
impl Send for TestApplicationBuilder
impl Sync for TestApplicationBuilder
impl Unpin for TestApplicationBuilder
impl UnsafeUnpin for TestApplicationBuilder
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