pub struct Application { /* private fields */ }Expand description
Built rivet runtime that implements the dispatch contract.
Implementations§
Source§impl Application
impl Application
Sourcepub fn route_count(&self) -> usize
pub fn route_count(&self) -> usize
Number of routes registered in the runtime.
Sourcepub fn middleware_count(&self) -> usize
pub fn middleware_count(&self) -> usize
Number of middleware instances in the runtime chain.
Sourcepub fn make<T: Any + Send + Sync + 'static>(&self) -> Result<Arc<T>, RivetError>
pub fn make<T: Any + Send + Sync + 'static>(&self) -> Result<Arc<T>, RivetError>
Resolve a typed service instance from the application container.
Sourcepub fn config(&self, key: &str) -> Option<ConfigValue>
pub fn config(&self, key: &str) -> Option<ConfigValue>
Read a configuration value by dot-notation key.
Sourcepub fn config_typed<T: FromConfigValue>(&self, key: &str) -> Option<T>
pub fn config_typed<T: FromConfigValue>(&self, key: &str) -> Option<T>
Read and convert a configuration value by dot-notation key.
Sourcepub fn init_logging(&self)
pub fn init_logging(&self)
Initialize rivet logging runtime and configured handlers.
Sourcepub fn log_serving(&self, addr: SocketAddr)
pub fn log_serving(&self, addr: SocketAddr)
Log that the application is starting to serve requests.
Trait Implementations§
Source§impl Dispatcher for Application
impl Dispatcher for Application
Source§fn dispatch(&self, req: Request) -> Response
fn dispatch(&self, req: Request) -> Response
Dispatch one request through routing and middleware.
Source§fn config_value(&self, key: &str) -> Option<ConfigValue>
fn config_value(&self, key: &str) -> Option<ConfigValue>
Read a config value when available (default: unsupported).
Source§fn resolve_any(
&self,
type_name: &'static str,
) -> Result<Arc<dyn Any + Send + Sync>, RivetError>
fn resolve_any( &self, type_name: &'static str, ) -> Result<Arc<dyn Any + Send + Sync>, RivetError>
Resolve a typed service by type name from the underlying app container.
Auto Trait Implementations§
impl Freeze for Application
impl !RefUnwindSafe for Application
impl Send for Application
impl Sync for Application
impl Unpin for Application
impl UnsafeUnpin for Application
impl !UnwindSafe for Application
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