pub trait HotReloadable: Send + Sync {
// Required method
fn refresh<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = PluginResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
// Provided methods
fn save_state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = PluginResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
fn restore_state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = PluginResult<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait { ... }
}Expand description
支持热加载的插件 trait
Required Methods§
Provided Methods§
Sourcefn save_state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = PluginResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn save_state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = PluginResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
保存当前状态
Sourcefn restore_state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = PluginResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn restore_state<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = PluginResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
恢复状态