pub struct AppStarter { /* private fields */ }Expand description
The lifecycle builder (Java AutoStart/AppStarter, explicit-registration
form). Build the application declaratively, then run it:
ⓘ
AppStarter::new()
.before_application(5, Arc::new(CompileCheck))
.preload("greeting.demo", TypedAdapter::arc(Greetings), 10)
.main_application(1, Arc::new(MainApp))
.run(std::env::args().collect())
.await?;Implementations§
Source§impl AppStarter
impl AppStarter
pub fn new() -> Self
Sourcepub fn before_application(
self,
sequence: u32,
hook: Arc<dyn EntryPoint>,
) -> Self
pub fn before_application( self, sequence: u32, hook: Arc<dyn EntryPoint>, ) -> Self
Register a before-application hook (Java @BeforeApplication).
sequence orders execution (lower first, clamped to 999; 0 is reserved
for the framework’s essential services — user code uses 1–999,
conventionally 3–999).
Sourcepub fn preload(
self,
route: &str,
function: Arc<dyn ComposableFunction>,
instances: usize,
) -> Self
pub fn preload( self, route: &str, function: Arc<dyn ComposableFunction>, instances: usize, ) -> Self
Register a composable function at startup (Java @PreLoad).
Sourcepub fn preload_with_options(
self,
route: &str,
function: Arc<dyn ComposableFunction>,
instances: usize,
options: FunctionOptions,
) -> Self
pub fn preload_with_options( self, route: &str, function: Arc<dyn ComposableFunction>, instances: usize, options: FunctionOptions, ) -> Self
Register a composable function with explicit options (Java @PreLoad
combined with @ZeroTracing and/or @EventInterceptor).
Sourcepub fn main_application(self, sequence: u32, entry: Arc<dyn EntryPoint>) -> Self
pub fn main_application(self, sequence: u32, entry: Arc<dyn EntryPoint>) -> Self
Register a main application (Java @MainApplication); sequence
orders execution when there is more than one (lower first).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for AppStarter
impl !UnwindSafe for AppStarter
impl Freeze for AppStarter
impl Send for AppStarter
impl Sync for AppStarter
impl Unpin for AppStarter
impl UnsafeUnpin for AppStarter
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