Issue passing mutable Arc reference to hyper service_fn handler
问题 I've been trying the following Relevant imports and code shown use std::sync::{Arc, Mutex}; use std::thread; use hyper::rt::{self, Future, Stream}; use hyper::service::service_fn; use hyper::{Body, Request, Response, Server, StatusCode}; pub struct ChallengeState; pub struct ChallengeResponse; type BoxFut<'a> = Box<Future<Item = Response<Body>, Error = hyper::Error> + Send + 'a>; fn handle_challengeproof<'a>( req: Request<Body>, challenge: &Arc<Mutex<ChallengeState>>, ) -> BoxFut<'a> { let