@@ -52,7 +52,9 @@ use crate::{
52
52
inputs:: { Input , InputConverter , UsesInput } ,
53
53
monitors:: Monitor ,
54
54
observers:: ObserversTuple ,
55
- state:: { HasExecutions , HasLastReportTime , HasMetadata , HasScalabilityMonitor , UsesState } ,
55
+ state:: {
56
+ HasExecutions , HasLastReportTime , HasMetadata , HasScalabilityMonitor , State , UsesState ,
57
+ } ,
56
58
Error ,
57
59
} ;
58
60
@@ -345,7 +347,7 @@ pub trait EventStatsCollector {}
345
347
/// using low-level message passing, [`libafl_bolts::llmp`].
346
348
pub struct LlmpEventManager < S , SP >
347
349
where
348
- S : UsesInput ,
350
+ S : State ,
349
351
SP : ShMemProvider + ' static ,
350
352
{
351
353
/// The LLMP client for inter process communication
@@ -405,7 +407,7 @@ where
405
407
impl < S , SP > core:: fmt:: Debug for LlmpEventManager < S , SP >
406
408
where
407
409
SP : ShMemProvider + ' static ,
408
- S : UsesInput ,
410
+ S : State ,
409
411
{
410
412
fn fmt ( & self , f : & mut core:: fmt:: Formatter < ' _ > ) -> core:: fmt:: Result {
411
413
let mut debug_struct = f. debug_struct ( "LlmpEventManager" ) ;
@@ -423,7 +425,7 @@ where
423
425
impl < S , SP > Drop for LlmpEventManager < S , SP >
424
426
where
425
427
SP : ShMemProvider + ' static ,
426
- S : UsesInput ,
428
+ S : State ,
427
429
{
428
430
/// LLMP clients will have to wait until their pages are mapped by somebody.
429
431
fn drop ( & mut self ) {
@@ -433,7 +435,7 @@ where
433
435
434
436
impl < S , SP > LlmpEventManager < S , SP >
435
437
where
436
- S : UsesInput ,
438
+ S : State ,
437
439
SP : ShMemProvider + ' static ,
438
440
{
439
441
/// Create a manager from a raw LLMP client
@@ -549,7 +551,7 @@ where
549
551
550
552
impl < S , SP > LlmpEventManager < S , SP >
551
553
where
552
- S : UsesInput + HasExecutions + HasMetadata ,
554
+ S : State + HasExecutions + HasMetadata ,
553
555
SP : ShMemProvider + ' static ,
554
556
{
555
557
// Handle arriving events in the client
@@ -627,7 +629,7 @@ where
627
629
}
628
630
}
629
631
630
- impl < S : UsesInput , SP : ShMemProvider > LlmpEventManager < S , SP > {
632
+ impl < S : State , SP : ShMemProvider > LlmpEventManager < S , SP > {
631
633
/// Send information that this client is exiting.
632
634
/// The other side may free up all allocated memory.
633
635
/// We are no longer allowed to send anything afterwards.
@@ -638,15 +640,15 @@ impl<S: UsesInput, SP: ShMemProvider> LlmpEventManager<S, SP> {
638
640
639
641
impl < S , SP > UsesState for LlmpEventManager < S , SP >
640
642
where
641
- S : UsesInput ,
643
+ S : State ,
642
644
SP : ShMemProvider ,
643
645
{
644
646
type State = S ;
645
647
}
646
648
647
649
impl < S , SP > EventFirer for LlmpEventManager < S , SP >
648
650
where
649
- S : UsesInput ,
651
+ S : State ,
650
652
SP : ShMemProvider ,
651
653
{
652
654
#[ cfg( feature = "llmp_compression" ) ]
@@ -740,7 +742,7 @@ where
740
742
741
743
impl < S , SP > EventRestarter for LlmpEventManager < S , SP >
742
744
where
743
- S : UsesInput ,
745
+ S : State ,
744
746
SP : ShMemProvider ,
745
747
{
746
748
/// The LLMP client needs to wait until a broker has mapped all pages before shutting down.
@@ -753,7 +755,7 @@ where
753
755
754
756
impl < E , S , SP , Z > EventProcessor < E , Z > for LlmpEventManager < S , SP >
755
757
where
756
- S : UsesInput + HasExecutions + HasMetadata + HasScalabilityMonitor ,
758
+ S : State + HasExecutions + HasMetadata + HasScalabilityMonitor ,
757
759
SP : ShMemProvider ,
758
760
E : HasObservers < State = S > + Executor < Self , Z > ,
759
761
for < ' a > E :: Observers : Deserialize < ' a > ,
@@ -800,15 +802,15 @@ impl<E, S, SP, Z> EventManager<E, Z> for LlmpEventManager<S, SP>
800
802
where
801
803
E : HasObservers < State = S > + Executor < Self , Z > ,
802
804
for < ' a > E :: Observers : Deserialize < ' a > ,
803
- S : UsesInput + HasExecutions + HasMetadata + HasLastReportTime + HasScalabilityMonitor ,
805
+ S : State + HasExecutions + HasMetadata + HasLastReportTime + HasScalabilityMonitor ,
804
806
SP : ShMemProvider ,
805
807
Z : EvaluatorObservers < E :: Observers , State = S > + ExecutionProcessor < E :: Observers , State = S > ,
806
808
{
807
809
}
808
810
809
811
impl < S , SP > HasCustomBufHandlers for LlmpEventManager < S , SP >
810
812
where
811
- S : UsesInput ,
813
+ S : State ,
812
814
SP : ShMemProvider ,
813
815
{
814
816
fn add_custom_buf_handler (
@@ -821,14 +823,14 @@ where
821
823
822
824
impl < S , SP > ProgressReporter for LlmpEventManager < S , SP >
823
825
where
824
- S : UsesInput + HasExecutions + HasMetadata + HasLastReportTime ,
826
+ S : State + HasExecutions + HasMetadata + HasLastReportTime ,
825
827
SP : ShMemProvider ,
826
828
{
827
829
}
828
830
829
831
impl < S , SP > HasEventManagerId for LlmpEventManager < S , SP >
830
832
where
831
- S : UsesInput ,
833
+ S : State ,
832
834
SP : ShMemProvider ,
833
835
{
834
836
/// Gets the id assigned to this staterestorer.
@@ -842,7 +844,7 @@ where
842
844
#[ derive( Debug ) ]
843
845
pub struct LlmpRestartingEventManager < S , SP >
844
846
where
845
- S : UsesInput ,
847
+ S : State ,
846
848
SP : ShMemProvider + ' static ,
847
849
//CE: CustomEvent<I>,
848
850
{
@@ -891,14 +893,14 @@ where
891
893
impl < S , SP > EventStatsCollector for LlmpRestartingEventManager < S , SP >
892
894
where
893
895
SP : ShMemProvider + ' static ,
894
- S : UsesInput ,
896
+ S : State ,
895
897
{
896
898
}
897
899
898
900
#[ cfg( feature = "std" ) ]
899
901
impl < S , SP > UsesState for LlmpRestartingEventManager < S , SP >
900
902
where
901
- S : UsesInput ,
903
+ S : State ,
902
904
SP : ShMemProvider + ' static ,
903
905
{
904
906
type State = S ;
@@ -907,7 +909,7 @@ where
907
909
#[ cfg( feature = "std" ) ]
908
910
impl < S , SP > ProgressReporter for LlmpRestartingEventManager < S , SP >
909
911
where
910
- S : UsesInput + HasExecutions + HasMetadata + HasLastReportTime + Serialize ,
912
+ S : State + HasExecutions + HasMetadata + HasLastReportTime + Serialize ,
911
913
SP : ShMemProvider ,
912
914
{
913
915
}
@@ -916,7 +918,7 @@ where
916
918
impl < S , SP > EventFirer for LlmpRestartingEventManager < S , SP >
917
919
where
918
920
SP : ShMemProvider ,
919
- S : UsesInput ,
921
+ S : State ,
920
922
//CE: CustomEvent<I>,
921
923
{
922
924
fn fire (
@@ -943,7 +945,7 @@ where
943
945
#[ cfg( feature = "std" ) ]
944
946
impl < S , SP > EventRestarter for LlmpRestartingEventManager < S , SP >
945
947
where
946
- S : UsesInput + HasExecutions + Serialize ,
948
+ S : State + HasExecutions + Serialize ,
947
949
SP : ShMemProvider ,
948
950
//CE: CustomEvent<I>,
949
951
{
@@ -981,7 +983,7 @@ impl<E, S, SP, Z> EventProcessor<E, Z> for LlmpRestartingEventManager<S, SP>
981
983
where
982
984
E : HasObservers < State = S > + Executor < LlmpEventManager < S , SP > , Z > ,
983
985
for < ' a > E :: Observers : Deserialize < ' a > ,
984
- S : UsesInput + HasExecutions + HasMetadata + HasScalabilityMonitor ,
986
+ S : State + HasExecutions + HasMetadata + HasScalabilityMonitor ,
985
987
SP : ShMemProvider + ' static ,
986
988
Z : EvaluatorObservers < E :: Observers , State = S > + ExecutionProcessor < E :: Observers > , //CE: CustomEvent<I>,
987
989
{
@@ -995,12 +997,7 @@ impl<E, S, SP, Z> EventManager<E, Z> for LlmpRestartingEventManager<S, SP>
995
997
where
996
998
E : HasObservers < State = S > + Executor < LlmpEventManager < S , SP > , Z > ,
997
999
for < ' a > E :: Observers : Deserialize < ' a > ,
998
- S : UsesInput
999
- + HasExecutions
1000
- + HasScalabilityMonitor
1001
- + HasMetadata
1002
- + HasLastReportTime
1003
- + Serialize ,
1000
+ S : State + HasExecutions + HasScalabilityMonitor + HasMetadata + HasLastReportTime + Serialize ,
1004
1001
SP : ShMemProvider + ' static ,
1005
1002
Z : EvaluatorObservers < E :: Observers , State = S > + ExecutionProcessor < E :: Observers > , //CE: CustomEvent<I>,
1006
1003
{
@@ -1009,7 +1006,7 @@ where
1009
1006
#[ cfg( feature = "std" ) ]
1010
1007
impl < S , SP > HasEventManagerId for LlmpRestartingEventManager < S , SP >
1011
1008
where
1012
- S : UsesInput + Serialize ,
1009
+ S : State + Serialize ,
1013
1010
SP : ShMemProvider + ' static ,
1014
1011
{
1015
1012
fn mgr_id ( & self ) -> EventManagerId {
@@ -1026,7 +1023,7 @@ const _ENV_FUZZER_BROKER_CLIENT_INITIAL: &str = "_AFL_ENV_FUZZER_BROKER_CLIENT";
1026
1023
#[ cfg( feature = "std" ) ]
1027
1024
impl < S , SP > LlmpRestartingEventManager < S , SP >
1028
1025
where
1029
- S : UsesInput ,
1026
+ S : State ,
1030
1027
SP : ShMemProvider + ' static ,
1031
1028
//CE: CustomEvent<I>,
1032
1029
{
@@ -1090,7 +1087,7 @@ pub fn setup_restarting_mgr_std<MT, S>(
1090
1087
) -> Result < ( Option < S > , LlmpRestartingEventManager < S , StdShMemProvider > ) , Error >
1091
1088
where
1092
1089
MT : Monitor + Clone ,
1093
- S : DeserializeOwned + UsesInput + HasExecutions ,
1090
+ S : DeserializeOwned + State + HasExecutions ,
1094
1091
{
1095
1092
RestartingMgr :: builder ( )
1096
1093
. shmem_provider ( StdShMemProvider :: new ( ) ?)
@@ -1151,7 +1148,7 @@ where
1151
1148
impl < MT , S , SP > RestartingMgr < MT , S , SP >
1152
1149
where
1153
1150
SP : ShMemProvider ,
1154
- S : UsesInput + HasExecutions + DeserializeOwned ,
1151
+ S : State + HasExecutions + DeserializeOwned ,
1155
1152
MT : Monitor + Clone ,
1156
1153
{
1157
1154
/// Launch the restarting manager
@@ -1608,7 +1605,7 @@ where
1608
1605
1609
1606
impl < IC , ICB , DI , S , SP > UsesState for LlmpEventConverter < IC , ICB , DI , S , SP >
1610
1607
where
1611
- S : UsesInput ,
1608
+ S : State ,
1612
1609
SP : ShMemProvider ,
1613
1610
IC : InputConverter < From = S :: Input , To = DI > ,
1614
1611
ICB : InputConverter < From = DI , To = S :: Input > ,
@@ -1619,7 +1616,7 @@ where
1619
1616
1620
1617
impl < IC , ICB , DI , S , SP > EventFirer for LlmpEventConverter < IC , ICB , DI , S , SP >
1621
1618
where
1622
- S : UsesInput ,
1619
+ S : State ,
1623
1620
SP : ShMemProvider ,
1624
1621
IC : InputConverter < From = S :: Input , To = DI > ,
1625
1622
ICB : InputConverter < From = DI , To = S :: Input > ,
0 commit comments