pub struct AppBootstrapper { /* private fields */ }Expand description
Early application initialization.
This helper type is used to configure the various low-level shared resources required by the application, such as the logging and metrics subsystems.
Implementations§
Source§impl AppBootstrapper
impl AppBootstrapper
Sourcepub fn new() -> Self
pub fn new() -> Self
Creates a new AppBootstrapper.
The bootstrapper is initialized with a simple logging configuration. Callers
that have application-specific logging requirements should follow up with
with_logging_configuration to override this default.
Sourcepub fn with_metrics_prefix<S: Into<String>>(self, prefix: S) -> Self
pub fn with_metrics_prefix<S: Into<String>>(self, prefix: S) -> Self
Sets the prefix to use for internal metrics.
Defaults to saluki.
Sourcepub fn with_metrics_default_level(self, level: Level) -> Self
pub fn with_metrics_default_level(self, level: Level) -> Self
Sets the default filter level for internal metrics.
Metrics whose level is more verbose than this default are filtered out at flush time. The default also drives the level that the filter is restored to whenever a runtime override is reset.
Defaults to Level::INFO.
Sourcepub fn with_logging_configuration(
self,
logging_config: LoggingConfiguration,
) -> Self
pub fn with_logging_configuration( self, logging_config: LoggingConfiguration, ) -> Self
Sourcepub async fn bootstrap(self) -> Result<Bootstrap, GenericError>
pub async fn bootstrap(self) -> Result<Bootstrap, GenericError>
Executes the bootstrap operation, initializing all configured subsystems.
Returns a Bootstrap containing both a BootstrapGuard (which must be held until the application is
ready to shut down) and a Supervisor populated with workers for all background async tasks created
during bootstrap. Callers must arrange for the supervisor to run (typically by adding it to a parent
supervisor or calling Supervisor::run_with_shutdown) for those workers to make progress.
§Errors
If any of the bootstrap steps fail, an error will be returned.
Auto Trait Implementations§
impl !Freeze for AppBootstrapper
impl RefUnwindSafe for AppBootstrapper
impl Send for AppBootstrapper
impl Sync for AppBootstrapper
impl Unpin for AppBootstrapper
impl UnwindSafe for AppBootstrapper
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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Track for T
impl<T> Track for T
Source§fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
fn track_resources(self, token: ResourceGroupToken) -> Tracked<Self>
Tracked wrapper. Read moreSource§fn in_current_resource_group(self) -> Tracked<Self>
fn in_current_resource_group(self) -> Tracked<Self>
Tracked wrapper. Read more