pub struct Application { /* private fields */ }Expand description
Represents the Molten API application, encapsulating the server’s network listener, application-wide state, and the port it is bound to.
Implementations§
Source§impl Application
impl Application
Sourcepub async fn build(config: Settings) -> Result<Self, BuildError>
pub async fn build(config: Settings) -> Result<Self, BuildError>
Builds a new Application instance by connecting to the database,
running pending migrations, and setting up the TCP listener.
§Arguments
config- The application settings loaded from configuration.
§Returns
A Result which is Ok with the Application instance if successful,
or Err with a BuildError if any step fails.
Auto Trait Implementations§
impl !Freeze for Application
impl !RefUnwindSafe for Application
impl Send for Application
impl Sync for Application
impl Unpin 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
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 more