pub struct EmoteSet { /* private fields */ }Expand description
name → emote lookup, precedence-respecting (first insert wins).
Implementations§
Source§impl EmoteSet
impl EmoteSet
pub fn new() -> EmoteSet
Sourcepub fn none() -> &'static EmoteSet
pub fn none() -> &'static EmoteSet
the shared empty set — “no per-message refs” without allocating one.
Sourcepub fn from_list(list: impl IntoIterator<Item = Emote>) -> EmoteSet
pub fn from_list(list: impl IntoIterator<Item = Emote>) -> EmoteSet
build from an API list. the server already ordered by precedence and deduped, but we defend with first-wins so a stray dup can’t override.
Sourcepub fn merge(&mut self, other: EmoteSet)
pub fn merge(&mut self, other: EmoteSet)
fold another set in, first-wins — a merged (multi-platform) tab pools its sources’ emotes into one lookup. the one exception: a channel emote always replaces a pooled GLOBAL of the same name, whichever arrived first — globals fetch in parallel with channel sets, so arrival order can’t be the precedence rule.
Sourcepub fn mark_global(&mut self)
pub fn mark_global(&mut self)
stamp every entry as coming from the pooled global set.
pub fn get(&self, name: &str) -> Option<&Emote>
Sourcepub fn names(&self) -> impl Iterator<Item = &str>
pub fn names(&self) -> impl Iterator<Item = &str>
all emote names (unordered) — completion feeds from this.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Forget for EmoteSet
impl Freeze for EmoteSet
impl RefUnwindSafe for EmoteSet
impl Send for EmoteSet
impl Sync for EmoteSet
impl Unpin for EmoteSet
impl UnsafeUnpin for EmoteSet
impl UnwindSafe for EmoteSet
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