evo_framework/framework/control/
icontrol.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
use crate::framework::ievo::IEvo;
/// Core trait for objects in the Evo framework.
/// Serves as a blueprint for objects to implement lifecycle methods
/// such as initialization and termination.
pub trait IControl: IEvo {
    /// Called when the object starts. This can be used to initialize
    /// or perform logic setup specific to the object.
    ///
    /// # Arguments
    /// * `obj` - An optional parameter for passing custom data or context
    fn on_start(&mut self, obj: Option<&dyn std::any::Any>);

    /// Called when the object stops. This can be used to clean up
    /// or perform shutdown logic specific to the object.
    ///
    /// # Arguments
    /// * `obj` - An optional parameter for passing custom data or context
    fn on_stop(&mut self, obj: Option<&dyn std::any::Any>);
}