pub trait VmiHandler<Driver, Os>{
type Output;
// Required method
fn handle_event(
&mut self,
event: VmiContext<'_, Driver, Os>,
) -> VmiEventResponse<<Driver as VmiDriver>::Architecture>;
// Provided methods
fn handle_timeout(&mut self, _session: &VmiSession<'_, Driver, Os>) { ... }
fn handle_interrupted(&mut self, _session: &VmiSession<'_, Driver, Os>) { ... }
fn check_completion(&self) -> Option<Self::Output> { ... }
}Expand description
A trait for handling VMI events.
A factory that creates a handler implementing this trait is passed to
the VmiSession::handle method to handle VMI events.
Required Associated Types§
Required Methods§
Sourcefn handle_event(
&mut self,
event: VmiContext<'_, Driver, Os>,
) -> VmiEventResponse<<Driver as VmiDriver>::Architecture>
fn handle_event( &mut self, event: VmiContext<'_, Driver, Os>, ) -> VmiEventResponse<<Driver as VmiDriver>::Architecture>
Handles a VMI event.
Provided Methods§
Sourcefn handle_timeout(&mut self, _session: &VmiSession<'_, Driver, Os>)
fn handle_timeout(&mut self, _session: &VmiSession<'_, Driver, Os>)
Handles a timeout event.
Sourcefn handle_interrupted(&mut self, _session: &VmiSession<'_, Driver, Os>)
fn handle_interrupted(&mut self, _session: &VmiSession<'_, Driver, Os>)
Handles an interrupted event.
Sourcefn check_completion(&self) -> Option<Self::Output>
fn check_completion(&self) -> Option<Self::Output>
Checks if the handler has completed.
This method is called after each event is handled. If the handler
has completed, this method should return the output of the handler.
Otherwise, it should return None.