pub struct HotReloadManager { /* private fields */ }Expand description
Hot-reload manager
Implementations§
Source§impl HotReloadManager
impl HotReloadManager
Sourcepub fn new(config: HotReloadConfig) -> Self
pub fn new(config: HotReloadConfig) -> Self
Create a new hot-reload manager
Sourcepub fn with_context(self, context: PluginContext) -> Self
pub fn with_context(self, context: PluginContext) -> Self
Set plugin context for initialization
Sourcepub fn subscribe(&self) -> Receiver<ReloadEvent>
pub fn subscribe(&self) -> Receiver<ReloadEvent>
Subscribe to reload events
Sourcepub fn registry(&self) -> Arc<PluginRegistry>
pub fn registry(&self) -> Arc<PluginRegistry>
Get the plugin registry
Sourcepub fn state_manager(&self) -> Arc<StateManager>
pub fn state_manager(&self) -> Arc<StateManager>
Get the state manager
Sourcepub async fn add_watch_path<P: AsRef<Path>>(
&self,
path: P,
) -> Result<(), ReloadError>
pub async fn add_watch_path<P: AsRef<Path>>( &self, path: P, ) -> Result<(), ReloadError>
Add a watch directory
Sourcepub async fn start(&mut self) -> Result<(), ReloadError>
pub async fn start(&mut self) -> Result<(), ReloadError>
Start the hot-reload manager
Sourcepub async fn stop(&mut self) -> Result<(), ReloadError>
pub async fn stop(&mut self) -> Result<(), ReloadError>
Stop the hot-reload manager
Sourcepub async fn load_plugin<P: AsRef<Path>>(
&self,
path: P,
) -> Result<String, ReloadError>
pub async fn load_plugin<P: AsRef<Path>>( &self, path: P, ) -> Result<String, ReloadError>
Load a plugin from path
Sourcepub async fn unload_plugin(&self, plugin_id: &str) -> Result<(), ReloadError>
pub async fn unload_plugin(&self, plugin_id: &str) -> Result<(), ReloadError>
Unload a plugin
Sourcepub async fn reload_plugin(
&self,
plugin_id: &str,
) -> Result<ReloadResult, ReloadError>
pub async fn reload_plugin( &self, plugin_id: &str, ) -> Result<ReloadResult, ReloadError>
Manually trigger a reload
Sourcepub async fn get_plugin_info(&self, plugin_id: &str) -> Option<PluginInfo>
pub async fn get_plugin_info(&self, plugin_id: &str) -> Option<PluginInfo>
Get a plugin reference
Sourcepub async fn execute(
&self,
plugin_id: &str,
input: String,
) -> PluginResult<String>
pub async fn execute( &self, plugin_id: &str, input: String, ) -> PluginResult<String>
Execute a plugin
Sourcepub async fn list_plugins(&self) -> Vec<String>
pub async fn list_plugins(&self) -> Vec<String>
List all loaded plugins
Sourcepub async fn is_running(&self) -> bool
pub async fn is_running(&self) -> bool
Check if manager is running
Trait Implementations§
Auto Trait Implementations§
impl Freeze for HotReloadManager
impl !RefUnwindSafe for HotReloadManager
impl Send for HotReloadManager
impl Sync for HotReloadManager
impl Unpin for HotReloadManager
impl UnsafeUnpin for HotReloadManager
impl !UnwindSafe for HotReloadManager
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