target_requests_outstanding: u32,
}
let mut outstanding: VecDeque<Outstanding> = default();
- let downbound: VecDeque<(/*xxx*/)> = default();
+ let mut downbound: VecDeque<RoutedPacketData> = default();
let try_send_response = |
reply_to: oneshot::Sender<WebResponse>,
select!{
biased;
+
// xxx something something routed something
req = web.recv() =>
use crate::prelude::*;
#[derive(Default,Clone)]
-pub struct Queue<E> {
+pub struct QueueBuf<E> {
content: usize,
eaten1: usize, // 0 <= eaten1 < queue.front()...len()
queue: VecDeque<E>,
}
#[derive(Default,Debug,Clone)]
-pub struct FrameQueue {
- queue: Queue<Cervine<'static, Box<[u8]>, [u8]>>,
+pub struct FrameQueueBuf {
+ queue: QueueBuf<Cervine<'static, Box<[u8]>, [u8]>>,
}
-impl<E> Debug for Queue<E> where E: AsRef<[u8]> {
+impl<E> Debug for QueueBuf<E> where E: AsRef<[u8]> {
#[throws(fmt::Error)]
fn fmt(&self, f: &mut fmt::Formatter) {
write!(f, "Queue{{content={},eaten1={},queue=[",
}
}
-impl<E> Queue<E> where E: AsRef<[u8]> {
+impl<E> QueueBuf<E> where E: AsRef<[u8]> {
pub fn push<B: Into<E>>(&mut self, b: B) {
self.push_(b.into());
}
pub fn is_empty(&self) -> bool { self.content == 0 }
}
-impl FrameQueue {
+impl FrameQueueBuf {
pub fn push<B: Into<Box<[u8]>>>(&mut self, b: B) {
self.push_(b.into());
}
pub fn is_empty(&self) -> bool { self.queue.is_empty() }
}
-impl<E> Extend<E> for FrameQueue where E: Into<Box<[u8]>> {
+impl<E> Extend<E> for FrameQueueBuf where E: Into<Box<[u8]>> {
fn extend<I>(&mut self, it: I)
where I: IntoIterator<Item=E>
{
}
}
-impl<E> hyper::body::Buf for Queue<E> where E: AsRef<[u8]> {
+impl<E> hyper::body::Buf for QueueBuf<E> where E: AsRef<[u8]> {
fn remaining(&self) -> usize { self.content }
fn chunk(&self) -> &[u8] {
let front = if let Some(f) = self.queue.front() { f } else { return &[] };
}
}
-impl hyper::body::Buf for FrameQueue {
+impl hyper::body::Buf for FrameQueueBuf {
fn remaining(&self) -> usize { self.queue.remaining() }
fn chunk(&self) -> &[u8] { self.queue.chunk() }
fn advance(&mut self, cnt: usize) { self.queue.advance(cnt) }