pub struct RefRing { /* private fields */ }Expand description
Bounded ring mapping recent wire IDs to message handles within one stream epoch. When an ID is reused or evicted, the old mapping retires.
Implementations§
Source§impl RefRing
impl RefRing
pub fn clear(&mut self)
Sourcepub fn record(&mut self, id: u8, handle: MessageHandle)
pub fn record(&mut self, id: u8, handle: MessageHandle)
Record id -> handle, retiring any previous mapping of id and the
oldest entry when full.
pub fn lookup(&self, id: u8) -> Option<MessageHandle>
pub fn lookup_handle(&self, handle: MessageHandle) -> Option<u8>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RefRing
impl RefUnwindSafe for RefRing
impl Send for RefRing
impl Sync for RefRing
impl Unpin for RefRing
impl UnwindSafe for RefRing
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)