pub struct Witchcraft { /* private fields */ }Expand description
The Witchcraft server context.
Implementations§
source§impl Witchcraft
impl Witchcraft
sourcepub fn metrics(&self) -> &Arc<MetricRegistry>
pub fn metrics(&self) -> &Arc<MetricRegistry>
Returns a reference to the server’s metric registry.
sourcepub fn health_checks(&self) -> &Arc<HealthCheckRegistry>
pub fn health_checks(&self) -> &Arc<HealthCheckRegistry>
Returns a reference to the server’s health check registry.
sourcepub fn readiness_checks(&self) -> &Arc<ReadinessCheckRegistry>
pub fn readiness_checks(&self) -> &Arc<ReadinessCheckRegistry>
Returns a reference to the server’s readiness check registry.
sourcepub fn client_factory(&self) -> &ClientFactory
pub fn client_factory(&self) -> &ClientFactory
Returns a reference to the server’s HTTP client factory.
sourcepub fn diagnostics(&self) -> &Arc<DiagnosticRegistry>
pub fn diagnostics(&self) -> &Arc<DiagnosticRegistry>
Returns a reference to the server’s diagnostics registry.
sourcepub fn blocking_app<T>(&mut self, service: T)
pub fn blocking_app<T>(&mut self, service: T)
Installs a blocking service at the server’s root.
sourcepub fn blocking_api<T>(&mut self, service: T)
pub fn blocking_api<T>(&mut self, service: T)
Installs a blocking service under the server’s /api prefix.
sourcepub fn on_shutdown<F>(&mut self, future: F)
pub fn on_shutdown<F>(&mut self, future: F)
Adds a future that will be run when the server begins its shutdown process.
The server will not shut down until the future completes or the configured shutdown timeout elapses.
Auto Trait Implementations§
impl !Freeze for Witchcraft
impl !RefUnwindSafe for Witchcraft
impl Send for Witchcraft
impl !Sync for Witchcraft
impl Unpin for Witchcraft
impl !UnwindSafe for Witchcraft
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
source§impl<I, T> ExtractContext<I, ()> for T
impl<I, T> ExtractContext<I, ()> for T
source§fn extract_context(self, _original_input: I)
fn extract_context(self, _original_input: I)
Given the context attached to a nom error, and given the original
input to the nom parser, extract more the useful context information. Read more
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 moresource§impl<I> RecreateContext<I> for I
impl<I> RecreateContext<I> for I
source§fn recreate_context(_original_input: I, tail: I) -> I
fn recreate_context(_original_input: I, tail: I) -> I
Given the original input, as well as the context reported by nom,
recreate a context in the original string where the error occurred. Read more