pub struct Emote {
pub id: String,
pub char_range: Range<usize>,
pub code: String,
}
Expand description
A single emote, appearing as part of a message.
Fields§
§id: String
An ID identifying this emote. For example 25
for the “Kappa” emote, but can also be non-numeric,
for example on emotes modified using Twitch channel points, e.g.
301512758_TK
for pajaDent_TK
where 301512758
is the ID of the original pajaDent
emote.
char_range: Range<usize>
A range of characters in the original message where the emote is placed.
As is documented on Range
, the start
index of this range is inclusive, while the
end
index is exclusive.
This is always the exact range of characters that Twitch originally sent. Note that due to a Twitch bug (that this library intentionally works around), the character range specified here might be out-of-bounds for the original message text string.
code: String
This is the text that this emote replaces, e.g. Kappa
or :)
.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Emote
impl<'de> Deserialize<'de> for Emote
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for Emote
impl StructuralPartialEq for Emote
Auto Trait Implementations§
impl Freeze for Emote
impl RefUnwindSafe for Emote
impl Send for Emote
impl Sync for Emote
impl Unpin for Emote
impl UnwindSafe for Emote
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more