serenity 0.12.5

A Rust library for the Discord API.
Documentation
use std::fmt;
use super::ArgumentConvert;
use crate::{model::prelude::*, prelude::*};

/// Error that can be returned from [`PLACEHOLDER::convert`].
#[non_exhaustive]
#[derive(Clone, Copy, Debug, Eq, Hash, PartialEq)]
pub enum PLACEHOLDERParseError {
}

impl std::error::Error for PLACEHOLDERParseError {}

impl fmt::Display for PLACEHOLDERParseError {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        match self {
        }
    }
}

/// Look up a [`PLACEHOLDER`] by a string case-insensitively.
///
/// Requires the cache feature to be enabled.
///
/// The lookup strategy is as follows (in order):
/// 1. Lookup by PLACEHOLDER
/// 2. [Lookup by PLACEHOLDER](`crate::utils::parse_PLACEHOLDER`).
#[async_trait::async_trait]
impl ArgumentConvert for PLACEHOLDER {
    type Err = PLACEHOLDERParseError;

    async fn convert(
        ctx: impl CacheHttp,
        guild_id: Option<GuildId>,
        _channel_id: Option<ChannelId>,
        s: &str,
    ) -> Result<Self, Self::Err> {
        let lookup_by_PLACEHOLDER = || PLACEHOLDER;

        lookup_by_PLACEHOLDER()
            .or_else(lookup_by_PLACEHOLDER)
            .or_else(lookup_by_PLACEHOLDER)
            .cloned()
            .ok_or(PLACEHOLDERParseError::NotFoundOrMalformed)
    }
}