pub fn wait(&mut self, timeout: Option<Duration>) -> Option<&F> {
        if !self.done {
            match timeout {
                Some(timeout) => {
                    if let Ok(result) = self.result_receiver.recv_timeout(timeout) {
                        self.done = true;
                        self.result = Some(result);
                    }
                },
                None => {
                    if let Ok(result) = self.result_receiver.recv() {
                        self.done = true;
                        self.result = Some(result);
                    }
                }
            }
        }

        self.result.as_ref()
    }
/// Wait for execution result
/// 
/// If `timeout = None`, then this function will wait
/// until the inner function will not return its result
Wait for execution result
If `timeout = None`, then this function will wait
until the inner function will not return its result
Wait for execution result If ` timeout = None ` then this function will wait until the inner function will not return its result
pub fn wait(&mut self, timeout: Option<Duration>) -> Option<&F> {
        if !self.done {
            match timeout {
                Some(timeout) => {
                    if let Ok(result) = self.result_receiver.recv_timeout(timeout) {
                        self.done = true;
                        self.result = Some(result);
                    }
                },
                None => {
                    if let Ok(result) = self.result_receiver.recv() {
                        self.done = true;
                        self.result = Some(result);
                    }
                }
            }
        }
        self.result.as_ref()
    }
pub fn wait ( & mut self , timeout : Option < Duration > ) -> Option < & F > { if ! self . done { match timeout { Some ( timeout ) => { if let Ok ( result ) = self . result_receiver . recv_timeout ( timeout ) { self . done = true ; self . result = Some ( result ) ; } } , None => { if let Ok ( result ) = self . result_receiver . recv ( ) { self . done = true ; self . result = Some ( result ) ; } } } } self . result . as_ref ( ) }
Wait for execution result
If `timeout = None`, then this function will wait
until the inner function will not return its result
Wait for execution result If ` timeout = None ` then this function will wait until the inner function will not return its result
&mut self
timeout
Option<Duration>
&mut self
timeout
Option<Duration>