Trait Builder

Source
pub trait Builder {
    type Context<'ctx>;
    type Built;

    // Required method
    fn execute<'life0, 'async_trait>(
        self,
        cache_http: impl 'async_trait + CacheHttp,
        ctx: Self::Context<'life0>,
    ) -> Pin<Box<dyn Future<Output = Result<Self::Built>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Common trait for all HTTP request builders in this module.

Required Associated Types§

Source

type Context<'ctx>

Additional data that’s only required when sending a request off to the API.

Source

type Built

Required Methods§

Source

fn execute<'life0, 'async_trait>( self, cache_http: impl 'async_trait + CacheHttp, ctx: Self::Context<'life0>, ) -> Pin<Box<dyn Future<Output = Result<Self::Built>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Serializes a builder’s fields and sends the request off the API, returning the response.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl Builder for CreateInteractionResponse

Source§

type Context<'ctx> = (InteractionId, &'ctx str)

Source§

type Built = ()

Source§

impl Builder for AddMember

Source§

impl Builder for CreateAutocompleteResponse

Source§

type Context<'ctx> = (InteractionId, &'ctx str)

Source§

type Built = ()

Source§

impl Builder for CreateChannel<'_>

Source§

impl Builder for CreateCommand

Source§

impl Builder for CreateForumPost<'_>

Source§

impl Builder for CreateInteractionResponseFollowup

Source§

impl Builder for CreateInvite<'_>

Source§

impl Builder for CreateMessage

Source§

impl Builder for CreateScheduledEvent<'_>

Source§

impl Builder for CreateStageInstance<'_>

Source§

impl Builder for CreateSticker<'_>

Source§

impl Builder for CreateThread<'_>

Source§

impl Builder for CreateWebhook<'_>

Source§

impl Builder for EditAutoModRule<'_>

Source§

impl Builder for EditChannel<'_>

Source§

impl Builder for EditCommandPermissions

Source§

impl Builder for EditGuild<'_>

Source§

impl Builder for EditGuildWelcomeScreen<'_>

Source§

impl Builder for EditGuildWidget<'_>

Source§

impl Builder for EditInteractionResponse

Source§

type Context<'ctx> = &'ctx str

Source§

type Built = Message

Source§

impl Builder for EditMember<'_>

Source§

impl Builder for EditMessage

Source§

impl Builder for EditProfile

Source§

impl Builder for EditRole<'_>

Source§

impl Builder for EditScheduledEvent<'_>

Source§

impl Builder for EditStageInstance<'_>

Source§

impl Builder for EditSticker<'_>

Source§

impl Builder for EditThread<'_>

Source§

impl Builder for EditVoiceState

Source§

impl Builder for EditWebhook<'_>

Source§

impl Builder for EditWebhookMessage

Source§

impl Builder for ExecuteWebhook

Source§

impl Builder for GetEntitlements

Source§

impl Builder for GetMessages