pub struct ForgeBuilder { /* private fields */ }Expand description
Builder for configuring the FORGE runtime.
Implementations§
Source§impl ForgeBuilder
impl ForgeBuilder
Sourcepub fn migrations_dir(self, path: impl Into<PathBuf>) -> Self
pub fn migrations_dir(self, path: impl Into<PathBuf>) -> Self
Set the directory to load migrations from.
Defaults to ./migrations. Migration files should be named like:
0001_create_users.sql0002_add_posts.sql
Sourcepub fn migration(self, name: impl Into<String>, sql: impl Into<String>) -> Self
pub fn migration(self, name: impl Into<String>, sql: impl Into<String>) -> Self
Add a migration programmatically.
Use this for migrations that need to be generated at runtime, or for testing. For most cases, use migration files instead.
Sourcepub fn frontend_handler(
&mut self,
handler: fn(Request<Body>) -> Pin<Box<dyn Future<Output = Response> + Send>>,
)
pub fn frontend_handler( &mut self, handler: fn(Request<Body>) -> Pin<Box<dyn Future<Output = Response> + Send>>, )
Set a frontend handler for serving embedded SPA assets.
Use with the embedded-frontend feature to build a single binary
that includes both backend and frontend.
Sourcepub fn config(self, config: ForgeConfig) -> Self
pub fn config(self, config: ForgeConfig) -> Self
Set the configuration.
Sourcepub fn function_registry_mut(&mut self) -> &mut FunctionRegistry
pub fn function_registry_mut(&mut self) -> &mut FunctionRegistry
Get mutable access to the function registry.
Sourcepub fn job_registry_mut(&mut self) -> &mut JobRegistry
pub fn job_registry_mut(&mut self) -> &mut JobRegistry
Get mutable access to the job registry.
Sourcepub fn cron_registry_mut(&mut self) -> &mut CronRegistry
pub fn cron_registry_mut(&mut self) -> &mut CronRegistry
Get mutable access to the cron registry.
Sourcepub fn workflow_registry_mut(&mut self) -> &mut WorkflowRegistry
pub fn workflow_registry_mut(&mut self) -> &mut WorkflowRegistry
Get mutable access to the workflow registry.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ForgeBuilder
impl !RefUnwindSafe for ForgeBuilder
impl Send for ForgeBuilder
impl Sync for ForgeBuilder
impl Unpin for ForgeBuilder
impl !UnwindSafe for ForgeBuilder
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