pub struct BootstrapRunner<T> { /* private fields */ }Expand description
Executes bootstrap steps in dependency order.
The runner uses topological sort to determine execution order, ensuring that dependencies are satisfied before each step runs. Each step runs in its own transaction with the bootstrap RLS bypass.
The Default implementation pre-registers all builtin bootstrap steps:
system_tenant: Creates system and default tenantssuper_admin: Creates the super-admin userglobal_roles: Creates global default rolesagent_service_token: Creates the agent service token
Use BootstrapRunner::new for an empty runner if you need custom step configuration.
Implementations§
Source§impl<T> BootstrapRunner<T>where
T: DatabaseConnection,
T::Error: Into<BootstrapError<T::Error>>,
BootstrapError<T::Error>: From<T::Error>,
impl<T> BootstrapRunner<T>where
T: DatabaseConnection,
T::Error: Into<BootstrapError<T::Error>>,
BootstrapError<T::Error>: From<T::Error>,
Sourcepub fn add_step<S: BootstrapStep<T> + 'static>(&mut self, step: S)
pub fn add_step<S: BootstrapStep<T> + 'static>(&mut self, step: S)
Adds a bootstrap step to the runner.
Steps can be added in any order. The runner will execute them in dependency order based on their declared dependencies.
Sourcepub async fn run(
&mut self,
db: &T,
options: &RunOptions,
) -> Result<BootstrapSummary, BootstrapError<T::Error>>
pub async fn run( &mut self, db: &T, options: &RunOptions, ) -> Result<BootstrapSummary, BootstrapError<T::Error>>
Runs all bootstrap steps in dependency order.
Auto Trait Implementations§
impl<T> Freeze for BootstrapRunner<T>
impl<T> !RefUnwindSafe for BootstrapRunner<T>
impl<T> Send for BootstrapRunner<T>
impl<T> Sync for BootstrapRunner<T>
impl<T> Unpin for BootstrapRunner<T>
impl<T> UnsafeUnpin for BootstrapRunner<T>
impl<T> !UnwindSafe for BootstrapRunner<T>
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