wireframe 0.3.0

Simplify building servers and clients for custom binary protocols.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! Connection channel bundling for actor construction.

use crate::push::{PushHandle, PushQueues};

/// Bundles push queues with their shared handle for actor construction.
pub struct ConnectionChannels<F> {
    /// Receivers for high- and low-priority frames consumed by the actor.
    pub queues: PushQueues<F>,
    /// Handle cloned by producers to enqueue frames into the shared queues.
    pub handle: PushHandle<F>,
}

impl<F> ConnectionChannels<F> {
    /// Create a new bundle of push queues and their associated handle.
    #[must_use]
    pub fn new(queues: PushQueues<F>, handle: PushHandle<F>) -> Self { Self { queues, handle } }
}