chiark / gitweb /
rename [Frame]QueueBuf
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 22 Aug 2021 15:04:08 +0000 (16:04 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sun, 22 Aug 2021 15:04:08 +0000 (16:04 +0100)
Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
client/client.rs
server/suser.rs
src/queue.rs

index e3548d4ddd949218094c1d6b23f75005b8d0932a..cd87c8ad9ceb9b4f87117d2c96d5f51c96178c66 100644 (file)
@@ -192,7 +192,7 @@ async fn run_client<C:HCC>(
   let mut reqs: Vec<OutstandingRequest>
     = Vec::with_capacity(ic.max_requests_outstanding.sat());
 
-  let mut rx_queue: FrameQueue = default();
+  let mut rx_queue: FrameQueueBuf = default();
 
   let trouble = async {
     loop {
index b4e3e52bf53ffc5eb42f414d077238d7faab0685..28929d9e8afa0c930f843fd5eb0c57eda3f7b147 100644 (file)
@@ -28,7 +28,7 @@ pub async fn run(global: Arc<Global>,
     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>,
@@ -61,6 +61,7 @@ pub async fn run(global: Arc<Global>,
     select!{
       biased;
 
+      
       // xxx something something routed something
 
       req = web.recv() =>
index ba1d4ffedf76bbf55056e6e2b3824ed972000258..c87e1d7b5a9c45cce1c877a41ea3d98efb88635b 100644 (file)
@@ -5,18 +5,18 @@
 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=[",
@@ -26,7 +26,7 @@ impl<E> Debug for Queue<E> where E: AsRef<[u8]> {
   }
 }
 
-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());
   }
@@ -38,7 +38,7 @@ impl<E> Queue<E> where E: AsRef<[u8]> {
   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());
   }
@@ -49,7 +49,7 @@ impl FrameQueue {
   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>
   {
@@ -57,7 +57,7 @@ impl<E> Extend<E> for FrameQueue where E: Into<Box<[u8]>> {
   }
 }
 
-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 &[] };
@@ -76,7 +76,7 @@ impl<E> hyper::body::Buf for Queue<E> where E: AsRef<[u8]> {
   }
 }
 
-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) }