pub struct FrameRouter { /* private fields */ }Expand description
Allocates message ids and queues inbound server frames for a connection.
Implementations§
Source§impl FrameRouter
impl FrameRouter
Sourcepub fn fresh_msg_id(&self) -> u64
pub fn fresh_msg_id(&self) -> u64
Allocates and returns the next unique message id.
Sourcepub fn peek_next_msg_id(&self) -> u64
pub fn peek_next_msg_id(&self) -> u64
Returns the message id the next FrameRouter::fresh_msg_id call would
produce, without consuming it.
Sourcepub fn push_inbound(&self, frame: ServerFrame) -> Result<()>
pub fn push_inbound(&self, frame: ServerFrame) -> Result<()>
Pushes a frame onto the back of the inbound queue.
Returns Error::PoisonedLock rather than panicking when the queue
mutex is poisoned, matching the sibling server locks.
Sourcepub fn pop_inbound(&self) -> Result<Option<ServerFrame>>
pub fn pop_inbound(&self) -> Result<Option<ServerFrame>>
Pops the next frame from the front of the inbound queue, if any.
Returns Error::PoisonedLock rather than panicking when the queue
mutex is poisoned, matching the sibling server locks.
Trait Implementations§
Source§impl Default for FrameRouter
impl Default for FrameRouter
Source§fn default() -> FrameRouter
fn default() -> FrameRouter
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for FrameRouter
impl RefUnwindSafe for FrameRouter
impl Send for FrameRouter
impl Sync for FrameRouter
impl Unpin for FrameRouter
impl UnsafeUnpin for FrameRouter
impl UnwindSafe for FrameRouter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more