pub struct InputTable { /* private fields */ }Expand description
A connection’s open input halves, keyed by subscription, the slot of
BIDIR-5’s rule: (connection, subscription). The transport makes one a
connection, puts it on its calls’ FrameSink (with_inputs) and hands it frames.
Implementations§
Source§impl InputTable
impl InputTable
Sourcepub fn new(conn: u64, calls: Arc<dyn CallCounter>) -> Arc<Self> ⓘ
pub fn new(conn: u64, calls: Arc<dyn CallCounter>) -> Arc<Self> ⓘ
The table of connection conn, its calls counted by calls.
Sourcepub fn idle(&self) -> bool
pub fn idle(&self) -> bool
Whether no input half is open: one load, so a connection with none reads its frames as it always did.
Sourcepub fn strays(&self) -> u64
pub fn strays(&self) -> u64
Input frames that named no call of this connection and could not be told so (a notification has no answer): counted, dropped.
Sourcepub fn take_frame(&self, data: &Bytes) -> bool
pub fn take_frame(&self, data: &Bytes) -> bool
A whole inbound message, if it is an input notification: true, it
is taken. Run on the socket’s reader, in arrival order. A frame with
an id goes through the method table, which answers it.
Sourcepub fn input(&self, ns: &str, params: &[u8], frame: &Bytes) -> Delivered
pub fn input(&self, ns: &str, params: &[u8], frame: &Bytes) -> Delivered
{ns}.input: params a slice of frame, or frame itself.
Sourcepub fn take_binary(&self, frame: &Bytes) -> Delivered
pub fn take_binary(&self, frame: &Bytes) -> Delivered
BIDIR-17: a WebSocket binary message whose first byte is
BINARY_INPUT: one item, its payload a slice of frame. Run on the
socket’s reader, in arrival order, as Self::take_frame.
Malformed (a short header, another tag) is the transport’s to
answer; a frame naming no call of this connection is counted.