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 a channel API list. the server sends the winner of a name
LAST ([bttv, 7tv, ffz] for last-writer-wins clients, so ffz > 7tv >
bttv), so a later entry replaces an earlier one.
Sourcepub fn from_global_list(list: impl IntoIterator<Item = Emote>) -> EmoteSet
pub fn from_global_list(list: impl IntoIterator<Item = Emote>) -> EmoteSet
build from the pooled global list (/api/emotes), stamped global. its
row order says nothing about providers, so rank them here: 7tv > bttv >
ffz > twitch (the extension’s global order), losers first.
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.