pub struct ScriptingEngineInitializerWithSetup<F: Fn(&mut Engine) + Send + Sync + 'static> { /* private fields */ }Expand description
Loco initializer for the Rhai scripting engine with custom setup.
Implementations§
Source§impl<F: Fn(&mut Engine) + Send + Sync + 'static> ScriptingEngineInitializerWithSetup<F>
impl<F: Fn(&mut Engine) + Send + Sync + 'static> ScriptingEngineInitializerWithSetup<F>
Sourcepub fn new_with_setup(setup: F) -> Self
pub fn new_with_setup(setup: F) -> Self
Create a new ScriptingEngineInitializerWithSetup instance with custom setup for the Rhai Engine.
Trait Implementations§
Source§impl<F: Default + Fn(&mut Engine) + Send + Sync + 'static> Default for ScriptingEngineInitializerWithSetup<F>
impl<F: Default + Fn(&mut Engine) + Send + Sync + 'static> Default for ScriptingEngineInitializerWithSetup<F>
Source§fn default() -> ScriptingEngineInitializerWithSetup<F>
fn default() -> ScriptingEngineInitializerWithSetup<F>
Returns the “default value” for a type. Read more
Source§impl<F: Fn(&mut Engine) + Send + Sync + 'static> Initializer for ScriptingEngineInitializerWithSetup<F>
impl<F: Fn(&mut Engine) + Send + Sync + 'static> Initializer for ScriptingEngineInitializerWithSetup<F>
Source§fn after_routes<'life0, 'life1, 'async_trait>(
&'life0 self,
router: AxumRouter,
ctx: &'life1 AppContext,
) -> Pin<Box<dyn Future<Output = Result<AxumRouter>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn after_routes<'life0, 'life1, 'async_trait>(
&'life0 self,
router: AxumRouter,
ctx: &'life1 AppContext,
) -> Pin<Box<dyn Future<Output = Result<AxumRouter>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Occurs after the app’s
after_routes.
Use this to compose additional functionality and wire it into an Axum
RouterSource§fn before_run<'life0, 'life1, 'async_trait>(
&'life0 self,
_app_context: &'life1 AppContext,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn before_run<'life0, 'life1, 'async_trait>(
&'life0 self,
_app_context: &'life1 AppContext,
) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Occurs after the app’s
before_run.
Use this to for one-time initializations, load caches, perform web
hooks, etc.Source§fn check<'life0, 'life1, 'async_trait>(
&'life0 self,
_app_context: &'life1 AppContext,
) -> Pin<Box<dyn Future<Output = Result<Option<Check>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn check<'life0, 'life1, 'async_trait>(
&'life0 self,
_app_context: &'life1 AppContext,
) -> Pin<Box<dyn Future<Output = Result<Option<Check>, Error>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Perform health checks for this initializer.
This method is called during the doctor command to validate the initializer’s configuration.
Return
None if no check is needed, or Some(Check) if a check should be performed.Auto Trait Implementations§
impl<F> Freeze for ScriptingEngineInitializerWithSetup<F>where
F: Freeze,
impl<F> RefUnwindSafe for ScriptingEngineInitializerWithSetup<F>where
F: RefUnwindSafe,
impl<F> Send for ScriptingEngineInitializerWithSetup<F>
impl<F> Sync for ScriptingEngineInitializerWithSetup<F>
impl<F> Unpin for ScriptingEngineInitializerWithSetup<F>where
F: Unpin,
impl<F> UnwindSafe for ScriptingEngineInitializerWithSetup<F>where
F: UnwindSafe,
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