{
struct Outstanding {
reply_to: tokio::sync::oneshot::Sender<WebResponse>,
+ oi: OutstandingInner,
+ }
+ #[derive(Debug)]
+ struct OutstandingInner {
target_requests_outstanding: u32,
}
let mut outstanding: VecDeque<Outstanding> = default();
if ! downbound.is_empty() {
outstanding.pop_front()
} else if let Some((i,_)) = outstanding.iter().enumerate().find({
- |(_,o)| outstanding.len() > o.target_requests_outstanding.sat()
+ |(_,o)| outstanding.len() > o.oi.target_requests_outstanding.sat()
}) {
Some(outstanding.remove(i).unwrap())
} else {
dbg!(comp.name, DumpHex(comp.payload));
}
- Ok::<_,AE>(target_requests_outstanding)
+ let oi = OutstandingInner {
+ target_requests_outstanding,
+ };
+ Ok::<_,AE>(oi)
}.await {
- Ok(target_requests_outstanding) => {
- outstanding.push_back(Outstanding {
- reply_to,
- target_requests_outstanding,
- });
- },
+ Ok(oi) => outstanding.push_back(Outstanding { reply_to, oi }),
Err(e) => {
try_send_response(reply_to, WebResponse {
data: Err(e),