pub struct Builder { /* private fields */ }Expand description
Builds an Application from rivet modules and foundation backends.
Build order is deterministic:
- configure modules
- collect/register/boot providers
- collect routes
- collect middleware
Implementations§
Source§impl Builder
impl Builder
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create a new builder using default in-memory foundation backends.
Sourcepub fn new(container: Arc<dyn Container>, config: Box<dyn Config>) -> Self
pub fn new(container: Arc<dyn Container>, config: Box<dyn Config>) -> Self
Create a new builder with a foundation container and config backend.
Sourcepub fn with_module(self, module: Box<dyn RivetModule>) -> Self
pub fn with_module(self, module: Box<dyn RivetModule>) -> Self
Register a module in build order.
Sourcepub fn with_provider(self, provider: ProviderFactory) -> Self
pub fn with_provider(self, provider: ProviderFactory) -> Self
Register one compile-time provider constructor.
Sourcepub fn with_providers(self, providers: &[ProviderFactory]) -> Self
pub fn with_providers(self, providers: &[ProviderFactory]) -> Self
Register a static provider constructor list.
Sourcepub fn module_count(&self) -> usize
pub fn module_count(&self) -> usize
Number of modules currently queued for build.
Sourcepub fn build(self) -> Result<Application, RivetError>
pub fn build(self) -> Result<Application, RivetError>
Build a runtime Application by executing all build stages.
Auto Trait Implementations§
impl Freeze for Builder
impl !RefUnwindSafe for Builder
impl Send for Builder
impl Sync for Builder
impl Unpin for Builder
impl UnsafeUnpin for Builder
impl !UnwindSafe for Builder
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