pub fn fuzz(istate: Box<dyn IFuzzyObj>) -> Result<thread::JoinHandle<Result<(), String>>, &'static str> {
        Ok(thread::spawn(move || {
            let banana = istate.state().info().bananaq();

            if !bananaq::push(&banana, &istate)? {
                return Err(format!("[bananaq] failed to push {}", 
                        istate.state().info().name))
            }
            let racer = 0 != istate.state().level();

            let mut fuzzy_state = FuzzyState::new(banana
                .upgrade()
                .ok_or(format!("[bananaq] bananaq#? is no longer"))?,
                istate);

            if let Err(e) = fuzzy_state.init() {
                return Err(format!("[bananaq] FuzzyState {} failed to init with message <{}>", 
                        fuzzy_state.istate.state().info().name, e))
            }
            if !bananaq::ctor_notify(fuzzy_state.istate.state().info()) {
                return Err(format!("[bananaq] FuzzyState {} <uid:{:?}> failed to register to queue", 
                    fuzzy_state.istate.state().info().name, fuzzy_state.istate.state().info().uid()))
            }

            bananaq::update(&fuzzy_state.istate.state().info())?;

            if !racer {
                thread::sleep(time::Duration::from_millis(
                    rand::thread_rng().gen_range(0..=bananaq::config(&banana)?.after_creation_sleep)));
            }

            for i in 0u16.. {//ok we want panic if we overdo it, as 0xFFFF is not reasonable fuzzing for any object ..
                fuzzy_state.istate.fuzzy_loop(i)?;

                thread::yield_now();
            }
            Ok(())
        }))
    }
/// forwarded new state to fuzz, therefore create special thread for it and handle fuzzing
///
/// - init
/// - handle notifications ( createstate + update )
/// - invoke fuzzy method
/// - yield to allow other threads and fuzzing more shuffling ( better to swap exec time between threads a lot )
/// - check for end-conditions of fuzz and quit
forwarded new state to fuzz, therefore create special thread for it and handle fuzzing
init
handle notifications ( createstate + update )
invoke fuzzy method
yield to allow other threads and fuzzing more shuffling ( better to swap exec time between threads a lot )
check for end-conditions of fuzz and quit
forwarded new state to fuzz therefore create special thread for it and handle fuzzing init handle notifications ( createstate + update ) invoke fuzzy method yield to allow other threads and fuzzing more shuffling ( better to swap exec time between threads a lot ) check for end - conditions of fuzz and quit
pub fn fuzz(istate: Box<dyn IFuzzyObj>) -> Result<thread::JoinHandle<Result<(), String>>, &'static str> {
        Ok(thread::spawn(move || {
            let banana = istate.state().info().bananaq();
            if !bananaq::push(&banana, &istate)? {
                return Err(format!("[bananaq] failed to push {}", 
                        istate.state().info().name))
            }
            let racer = 0 != istate.state().level();
            let mut fuzzy_state = FuzzyState::new(banana
                .upgrade()
                .ok_or(format!("[bananaq] bananaq#? is no longer"))?,
                istate);
            if let Err(e) = fuzzy_state.init() {
                return Err(format!("[bananaq] FuzzyState {} failed to init with message <{}>", 
                        fuzzy_state.istate.state().info().name, e))
            }
            if !bananaq::ctor_notify(fuzzy_state.istate.state().info()) {
                return Err(format!("[bananaq] FuzzyState {} <uid:{:?}> failed to register to queue", 
                    fuzzy_state.istate.state().info().name, fuzzy_state.istate.state().info().uid()))
            }
            bananaq::update(&fuzzy_state.istate.state().info())?;
            if !racer {
                thread::sleep(time::Duration::from_millis(
                    rand::thread_rng().gen_range(0..=bananaq::config(&banana)?.after_creation_sleep)));
            }
            for i in 0u16.. {//ok we want panic if we overdo it, as 0xFFFF is not reasonable fuzzing for any object ..
                fuzzy_state.istate.fuzzy_loop(i)?;
                thread::yield_now();
            }
            Ok(())
        }))
    }
pub fn fuzz ( istate : Box < dyn IFuzzyObj > ) -> Result < thread :: JoinHandle < Result < ( ) , String > > , & ' static str > { Ok ( thread :: spawn ( move | | { let banana = istate . state ( ) . info ( ) . bananaq ( ) ; if ! bananaq :: push ( & banana , & istate ) ? { return Err ( format ! ( " " istate state ( ) info ( ) name ) ) } let racer = 0 != istate . state ( ) . level ( ) ; let mut fuzzy_state = FuzzyState :: new ( banana . upgrade ( ) . ok_or ( format ! ( " " ) ) ? , istate ) ; if let Err ( e ) = fuzzy_state . init ( ) { return Err ( format ! ( " " fuzzy_state istate state ( ) info ( ) name e ) ) } if ! bananaq :: ctor_notify ( fuzzy_state . istate . state ( ) . info ( ) ) { return Err ( format ! ( " " fuzzy_state istate state ( ) info ( ) name fuzzy_state istate state ( ) info ( ) uid ( ) ) ) } bananaq :: update ( & fuzzy_state . istate . state ( ) . info ( ) ) ? ; if ! racer { thread :: sleep ( time :: Duration :: from_millis ( rand :: thread_rng ( ) . gen_range ( 0 ..= bananaq :: config ( & banana ) ? . after_creation_sleep ) ) ) ; } for i in 0u16 .. { //ok we want panic if we overdo it, as 0xFFFF is not reasonable fuzzing for any object .. fuzzy_state . istate . fuzzy_loop ( i ) ? ; thread :: yield_now ( ) ; } Ok ( ( ) ) } ) ) }
forwarded new state to fuzz, therefore create special thread for it and handle fuzzing
 init
 handle notifications ( createstate + update )
 invoke fuzzy method
 yield to allow other threads and fuzzing more shuffling ( better to swap exec time between threads a lot )
 check for end-conditions of fuzz and quit
forwarded new state to fuzz therefore create special thread for it and handle fuzzing init handle notifications ( createstate + update ) invoke fuzzy method yield to allow other threads and fuzzing more shuffling ( better to swap exec time between threads a lot ) check for end - conditions of fuzz and quit
istate
Box<dyn IFuzzyObj>
istate
Box<dyn IFuzzyObj>