pub struct ImageHash(/* private fields */);
Expand description
An image hash returned from the Discord API.
This type can be constructed via it’s FromStr
implementation, and can be turned into it’s
cannonical representation via std::fmt::Display
or serde::Serialize
.
§Example
use serenity::model::misc::ImageHash;
let image_hash: ImageHash = "f1eff024d9c85339c877985229ed8fec".parse().unwrap();
assert_eq!(image_hash.to_string(), String::from("f1eff024d9c85339c877985229ed8fec"));
Implementations§
Source§impl ImageHash
impl ImageHash
Sourcepub fn is_animated(&self) -> bool
pub fn is_animated(&self) -> bool
Returns if the linked image is animated, which means the hash starts with a_
.
§Example
use serenity::model::misc::ImageHash;
let animated_hash: ImageHash = "a_e3c0db7f38777778fb43081f8746ebc9".parse().unwrap();
assert!(animated_hash.is_animated());
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ImageHash
impl<'de> Deserialize<'de> for ImageHash
Source§fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
impl Copy for ImageHash
impl Eq for ImageHash
impl StructuralPartialEq for ImageHash
Auto Trait Implementations§
impl Freeze for ImageHash
impl RefUnwindSafe for ImageHash
impl Send for ImageHash
impl Sync for ImageHash
impl Unpin for ImageHash
impl UnwindSafe for ImageHash
Blanket Implementations§
Source§impl<T> ArgumentConvert for Twhere
T: FromStr,
impl<T> ArgumentConvert for Twhere
T: FromStr,
Source§fn convert<'life0, 'async_trait>(
__arg0: impl CacheHttp + 'async_trait,
__arg1: Option<GuildId>,
__arg2: Option<ChannelId>,
s: &'life0 str,
) -> Pin<Box<dyn Future<Output = Result<T, <T as ArgumentConvert>::Err>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
fn convert<'life0, 'async_trait>(
__arg0: impl CacheHttp + 'async_trait,
__arg1: Option<GuildId>,
__arg2: Option<ChannelId>,
s: &'life0 str,
) -> Pin<Box<dyn Future<Output = Result<T, <T as ArgumentConvert>::Err>> + Send + 'async_trait>>where
'life0: 'async_trait,
T: 'async_trait,
Parses a string
s
as a command parameter of this type.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
Source§impl<T> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
impl<T> CloneDebuggableStorage for Twhere
T: DebuggableStorage + Clone,
fn clone_storage(&self) -> Box<dyn CloneDebuggableStorage>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> CloneableStorage for T
impl<T> CloneableStorage for T
fn clone_storage(&self) -> Box<dyn CloneableStorage>
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
Compare self to
key
and return true
if they are equal.