fn record_request(&mut self, setting_type: SettingType, request: SettingRequest) {
        if self.last_requests.len() >= INSPECT_REQUESTS_COUNT {
            self.last_requests.pop_back();
        }

        let count = match self.last_requests.front() {
            Some(req) => req.count + 1,
            None => 0,
        };
        let timestamp = match clock::now().duration_since(SystemTime::UNIX_EPOCH) {
            Ok(elapsed) => elapsed.as_millis(),
            Err(_) => 0,
        };
        // std::u64::MAX maxes out at 20 digits.
        let node = self.inspect_node.create_child(format!("{:020}", count));
        let setting_property = node.create_string("setting_type", format!("{:?}", setting_type));
        let request_property = node.create_string("request", format!("{:?}", request));
        let timestamp = node.create_string("timestamp", timestamp.to_string());
        self.last_requests.push_front(RequestInfo {
            count,
            _node: node,
            _setting_type: setting_property,
            _request: request_property,
            _timestamp: timestamp,
        });
    }
/// Write a request to inspect.
Write a request to inspect.
Write a request to inspect .
fn record_request(&mut self, setting_type: SettingType, request: SettingRequest) {
        if self.last_requests.len() >= INSPECT_REQUESTS_COUNT {
            self.last_requests.pop_back();
        }
        let count = match self.last_requests.front() {
            Some(req) => req.count + 1,
            None => 0,
        };
        let timestamp = match clock::now().duration_since(SystemTime::UNIX_EPOCH) {
            Ok(elapsed) => elapsed.as_millis(),
            Err(_) => 0,
        };
        // std::u64::MAX maxes out at 20 digits.
        let node = self.inspect_node.create_child(format!("{:020}", count));
        let setting_property = node.create_string("setting_type", format!("{:?}", setting_type));
        let request_property = node.create_string("request", format!("{:?}", request));
        let timestamp = node.create_string("timestamp", timestamp.to_string());
        self.last_requests.push_front(RequestInfo {
            count,
            _node: node,
            _setting_type: setting_property,
            _request: request_property,
            _timestamp: timestamp,
        });
    }
fn record_request ( & mut self , setting_type : SettingType , request : SettingRequest ) { if self . last_requests . len ( ) >= INSPECT_REQUESTS_COUNT { self . last_requests . pop_back ( ) ; } let count = match self . last_requests . front ( ) { Some ( req ) => req . count + 1 , None => 0 , } ; let timestamp = match clock :: now ( ) . duration_since ( SystemTime :: UNIX_EPOCH ) { Ok ( elapsed ) => elapsed . as_millis ( ) , Err ( _ ) => 0 , } ; // std::u64::MAX maxes out at 20 digits. let node = self . inspect_node . create_child ( format ! ( " " count ) ) ; let setting_property = node . create_string ( " " , format ! ( " " setting_type ) ) ; let request_property = node . create_string ( " " , format ! ( " " request ) ) ; let timestamp = node . create_string ( " " , timestamp . to_string ( ) ) ; self . last_requests . push_front ( RequestInfo { count , _node : node , _setting_type : setting_property , _request : request_property , _timestamp : timestamp , } ) ; }
Write a request to inspect.
Write a request to inspect .
&mut self
setting_type
SettingType
request
SettingRequest
&mut self
setting_type
SettingType
request
SettingRequest