pub struct EditRing { /* private fields */ }Expand description
Bounded ring mapping an edit’s own wire ID back to the ID it replaced.
Senders name the original when referencing an edited message, but a sender that names the edit instead is easy to accommodate and impossible to distinguish from a stale reference otherwise, so references are chased through this ring before lookup. Recording chases one hop, so an edit of an edit collapses to the first original rather than forming a chain.
Implementations§
Source§impl EditRing
impl EditRing
pub fn clear(&mut self)
Sourcepub fn record(&mut self, edit_id: u8, original_id: u8)
pub fn record(&mut self, edit_id: u8, original_id: u8)
Record edit_id -> original_id, collapsing through any existing
mapping of original_id and evicting the oldest entry when full.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for EditRing
impl RefUnwindSafe for EditRing
impl Send for EditRing
impl Sync for EditRing
impl Unpin for EditRing
impl UnwindSafe for EditRing
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)