pub struct Sticker {
pub file: FileMeta,
pub width: u16,
pub height: u16,
pub kind: StickerKind,
pub format: StickerFormat,
pub thumb: Option<PhotoSize>,
pub emoji: Option<String>,
pub set_name: Option<String>,
}Expand description
This object represents a sticker.
Fields§
§file: FileMetaMetadata of the sticker file.
width: u16Sticker width, in pixels.
You can assume that max(width, height) = 512, min(width, height) <= 512. In other words one dimension is exactly 512 pixels and the other
is at most 512 pixels.
height: u16Sticker height, in pixels.
You can assume that max(width, height) = 512, min(width, height) <= 512. In other words one dimension is exactly 512 pixels and the other
is at most 512 pixels.
kind: StickerKindKind of this sticker - regular, mask or custom emoji.
In other words this represent how the sticker is presented, as a big picture/video, as a mask while editing pictures or as a custom emoji in messages.
format: StickerFormatFormat of this sticker - raster/.webp, animated/.tgs or
video/.webm.
In other words this represents how the sticker is encoded.
thumb: Option<PhotoSize>Sticker thumbnail in the .webp or .jpg format.
emoji: Option<String>Emoji associated with the sticker.
set_name: Option<String>Name of the sticker set to which the sticker belongs.
Implementations§
Source§impl Sticker
impl Sticker
Sourcepub fn is_raster(&self) -> bool
pub fn is_raster(&self) -> bool
Returns true is this is a “normal” raster sticker.
Alias to self.format.is_raster().
Sourcepub fn is_animated(&self) -> bool
pub fn is_animated(&self) -> bool
Returns true is this is an animated sticker.
Alias to self.format.is_animated().
Sourcepub fn is_video(&self) -> bool
pub fn is_video(&self) -> bool
Returns true is this is a video sticker.
Alias to self.format.is_video().
Methods from Deref<Target = StickerKind>§
Sourcepub fn type_(&self) -> StickerType
pub fn type_(&self) -> StickerType
Converts StickerKind to StickerType
Sourcepub fn is_regular(&self) -> bool
pub fn is_regular(&self) -> bool
Returns true if the sticker kind is Regular.
Sourcepub fn is_custom_emoji(&self) -> bool
pub fn is_custom_emoji(&self) -> bool
Returns true if the sticker kind is CustomEmoji.
Getter for StickerKind::Regular::premium_animation.
Sourcepub fn mask_position(&self) -> Option<MaskPosition>
pub fn mask_position(&self) -> Option<MaskPosition>
Getter for StickerKind::Mask::mask_position.
Sourcepub fn custom_emoji_id(&self) -> Option<&str>
pub fn custom_emoji_id(&self) -> Option<&str>
Getter for StickerKind::CustomEmoji::custom_emoji_id.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Sticker
impl<'de> Deserialize<'de> for Sticker
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>,
Source§impl Deref for Sticker
This allows calling StickerKind’s methods directly on Sticker.
impl Deref for Sticker
This allows calling StickerKind’s methods directly on Sticker.
use teloxide_core::types::Sticker;
let sticker: Sticker = todo!();
let _ = sticker.is_regular();
let _ = sticker.kind.is_regular();
let _ = sticker.mask_position();
let _ = sticker.kind.mask_position();impl StructuralPartialEq for Sticker
Auto Trait Implementations§
impl Freeze for Sticker
impl RefUnwindSafe for Sticker
impl Send for Sticker
impl Sync for Sticker
impl Unpin for Sticker
impl UnwindSafe for Sticker
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<T> Erasable for T
impl<T> Erasable for T
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