pub struct Session {
pub plugins_db: PluginsDB,
pub tree: Tree,
pub task_scheduler: TaskScheduler,
}
Expand description
Contain instances of structure needed by TAP.
Fields
plugins_db: PluginsDB
A PluginsDB instance
tree: Tree
A Tree instance
task_scheduler: TaskScheduler
A TaskScheduler instance
Implementations
sourceimpl Session
impl Session
sourcepub fn clear(&mut self)
pub fn clear(&mut self)
Replace tree and task_scheduler by a new intance.
sourcepub fn schedule(
&self,
plugin_name: &str,
argument: PluginArgument,
relaunch: bool
) -> Result<TaskId, Error>
pub fn schedule(
&self,
plugin_name: &str,
argument: PluginArgument,
relaunch: bool
) -> Result<TaskId, Error>
Create a crate::plugin::PluginInstance from plugin_name
and argument
add it to the scheduler and return it’s task id.
sourcepub fn run(
&self,
plugin_name: &str,
argument: PluginArgument,
relaunch: bool
) -> Result<PluginResult, Arc<Error>>
pub fn run(
&self,
plugin_name: &str,
argument: PluginArgument,
relaunch: bool
) -> Result<PluginResult, Arc<Error>>
Create a crate::plugin::PluginInstance, add it to an available worker, wait for it to be executed and return the results. This function is blocking the TaskScheduler, so must be avoided in multithreaded code.
sourcepub fn join(&self)
pub fn join(&self)
Join on all scheduled task. This function is blocking the TaskScheduler, so must be avoided in multithreaded code.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl !UnwindSafe for Session
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more