diff --git a/twilight-http/src/client/interaction.rs b/twilight-http/src/client/interaction.rs index be267e198b1..6dbc4793662 100644 --- a/twilight-http/src/client/interaction.rs +++ b/twilight-http/src/client/interaction.rs @@ -40,7 +40,7 @@ use twilight_model::{ /// /// let interaction_client = client.interaction(application_id); /// -/// let commands = interaction_client.global_commands().await?.models().await?; +/// let commands = interaction_client.global_commands().await?.model().await?; /// /// println!("there are {} global commands", commands.len()); /// # Ok(()) } diff --git a/twilight-http/src/client/mod.rs b/twilight-http/src/client/mod.rs index 0a87a570253..afdbd88d7de 100644 --- a/twilight-http/src/client/mod.rs +++ b/twilight-http/src/client/mod.rs @@ -289,7 +289,7 @@ impl Client { /// .interaction(application_id) /// .global_commands() /// .await? - /// .models() + /// .model() /// .await?; /// /// println!("there are {} global commands", commands.len()); @@ -2412,7 +2412,7 @@ impl Client { /// let client = Client::new("my token".to_owned()); /// /// let guild_id = Id::new(1); - /// let stickers = client.guild_stickers(guild_id).await?.models().await?; + /// let stickers = client.guild_stickers(guild_id).await?.model().await?; /// /// println!("{}", stickers.len()); /// # Ok(()) } diff --git a/twilight-http/src/request/application/command/get_global_commands.rs b/twilight-http/src/request/application/command/get_global_commands.rs index ca4a6441859..1398b09dc0b 100644 --- a/twilight-http/src/request/application/command/get_global_commands.rs +++ b/twilight-http/src/request/application/command/get_global_commands.rs @@ -2,7 +2,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -39,9 +39,9 @@ impl<'a> GetGlobalCommands<'a> { } impl IntoFuture for GetGlobalCommands<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/application/command/get_guild_command_permissions.rs b/twilight-http/src/request/application/command/get_guild_command_permissions.rs index aaaed5b7e96..77d1debf7ba 100644 --- a/twilight-http/src/request/application/command/get_guild_command_permissions.rs +++ b/twilight-http/src/request/application/command/get_guild_command_permissions.rs @@ -2,7 +2,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -37,9 +37,9 @@ impl<'a> GetGuildCommandPermissions<'a> { } impl IntoFuture for GetGuildCommandPermissions<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/application/command/get_guild_commands.rs b/twilight-http/src/request/application/command/get_guild_commands.rs index dd15019c64d..d4b5fed6c99 100644 --- a/twilight-http/src/request/application/command/get_guild_commands.rs +++ b/twilight-http/src/request/application/command/get_guild_commands.rs @@ -2,7 +2,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -48,9 +48,9 @@ impl<'a> GetGuildCommands<'a> { } impl IntoFuture for GetGuildCommands<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/application/command/set_global_commands.rs b/twilight-http/src/request/application/command/set_global_commands.rs index 7edaff33d5e..53a9a9530b7 100644 --- a/twilight-http/src/request/application/command/set_global_commands.rs +++ b/twilight-http/src/request/application/command/set_global_commands.rs @@ -2,7 +2,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -43,9 +43,9 @@ impl<'a> SetGlobalCommands<'a> { } impl IntoFuture for SetGlobalCommands<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/application/command/set_guild_commands.rs b/twilight-http/src/request/application/command/set_guild_commands.rs index 33ecba381ce..3289eb305e7 100644 --- a/twilight-http/src/request/application/command/set_guild_commands.rs +++ b/twilight-http/src/request/application/command/set_guild_commands.rs @@ -2,7 +2,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -49,9 +49,9 @@ impl<'a> SetGuildCommands<'a> { } impl IntoFuture for SetGuildCommands<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/application/command/update_command_permissions.rs b/twilight-http/src/request/application/command/update_command_permissions.rs index 2c577159a95..c855556d4f7 100644 --- a/twilight-http/src/request/application/command/update_command_permissions.rs +++ b/twilight-http/src/request/application/command/update_command_permissions.rs @@ -2,7 +2,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use serde::Serialize; @@ -64,9 +64,9 @@ impl<'a> UpdateCommandPermissions<'a> { } impl IntoFuture for UpdateCommandPermissions<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/channel/get_pins.rs b/twilight-http/src/request/channel/get_pins.rs index ba04c5fb808..2d04a1e9f3b 100644 --- a/twilight-http/src/request/channel/get_pins.rs +++ b/twilight-http/src/request/channel/get_pins.rs @@ -2,7 +2,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -25,9 +25,9 @@ impl<'a> GetPins<'a> { } impl IntoFuture for GetPins<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/channel/invite/get_channel_invites.rs b/twilight-http/src/request/channel/invite/get_channel_invites.rs index f94917269c0..31c74828151 100644 --- a/twilight-http/src/request/channel/invite/get_channel_invites.rs +++ b/twilight-http/src/request/channel/invite/get_channel_invites.rs @@ -2,7 +2,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -30,9 +30,9 @@ impl<'a> GetChannelInvites<'a> { } impl IntoFuture for GetChannelInvites<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/channel/message/get_channel_messages.rs b/twilight-http/src/request/channel/message/get_channel_messages.rs index 040069e3022..27f53125df2 100644 --- a/twilight-http/src/request/channel/message/get_channel_messages.rs +++ b/twilight-http/src/request/channel/message/get_channel_messages.rs @@ -3,7 +3,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -127,9 +127,9 @@ impl<'a> GetChannelMessages<'a> { } impl IntoFuture for GetChannelMessages<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/channel/message/get_channel_messages_configured.rs b/twilight-http/src/request/channel/message/get_channel_messages_configured.rs index dbd09a584f6..090c892ce63 100644 --- a/twilight-http/src/request/channel/message/get_channel_messages_configured.rs +++ b/twilight-http/src/request/channel/message/get_channel_messages_configured.rs @@ -2,7 +2,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -80,9 +80,9 @@ impl<'a> GetChannelMessagesConfigured<'a> { } impl IntoFuture for GetChannelMessagesConfigured<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/channel/reaction/get_reactions.rs b/twilight-http/src/request/channel/reaction/get_reactions.rs index 76497f13f36..1e1e4ce2ecb 100644 --- a/twilight-http/src/request/channel/reaction/get_reactions.rs +++ b/twilight-http/src/request/channel/reaction/get_reactions.rs @@ -3,7 +3,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -88,9 +88,9 @@ impl<'a> GetReactions<'a> { } impl IntoFuture for GetReactions<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/channel/thread/get_thread_members.rs b/twilight-http/src/request/channel/thread/get_thread_members.rs index b9cfb0afe13..f3cf8bca350 100644 --- a/twilight-http/src/request/channel/thread/get_thread_members.rs +++ b/twilight-http/src/request/channel/thread/get_thread_members.rs @@ -2,7 +2,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -85,9 +85,9 @@ impl<'a> GetThreadMembers<'a> { } impl IntoFuture for GetThreadMembers<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/channel/webhook/get_channel_webhooks.rs b/twilight-http/src/request/channel/webhook/get_channel_webhooks.rs index 777fc750f90..75447459050 100644 --- a/twilight-http/src/request/channel/webhook/get_channel_webhooks.rs +++ b/twilight-http/src/request/channel/webhook/get_channel_webhooks.rs @@ -2,7 +2,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -25,9 +25,9 @@ impl<'a> GetChannelWebhooks<'a> { } impl IntoFuture for GetChannelWebhooks<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/get_voice_regions.rs b/twilight-http/src/request/get_voice_regions.rs index 133f0c017bb..0b96f144070 100644 --- a/twilight-http/src/request/get_voice_regions.rs +++ b/twilight-http/src/request/get_voice_regions.rs @@ -2,7 +2,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -21,9 +21,9 @@ impl<'a> GetVoiceRegions<'a> { } impl IntoFuture for GetVoiceRegions<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/guild/auto_moderation/get_guild_auto_moderation_rules.rs b/twilight-http/src/request/guild/auto_moderation/get_guild_auto_moderation_rules.rs index 5def1ce48da..cd7786f6d53 100644 --- a/twilight-http/src/request/guild/auto_moderation/get_guild_auto_moderation_rules.rs +++ b/twilight-http/src/request/guild/auto_moderation/get_guild_auto_moderation_rules.rs @@ -2,7 +2,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -29,9 +29,9 @@ impl<'a> GetGuildAutoModerationRules<'a> { } impl IntoFuture for GetGuildAutoModerationRules<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/guild/ban/get_bans.rs b/twilight-http/src/request/guild/ban/get_bans.rs index 14bc4477955..2486fc306a1 100644 --- a/twilight-http/src/request/guild/ban/get_bans.rs +++ b/twilight-http/src/request/guild/ban/get_bans.rs @@ -2,7 +2,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -42,7 +42,7 @@ struct GetBansFields { /// let user_id = Id::new(2); /// /// let response = client.bans(guild_id).after(user_id).limit(25).await?; -/// let bans = response.models().await?; +/// let bans = response.model().await?; /// /// for ban in bans { /// println!("{} was banned for: {:?}", ban.user.name, ban.reason); @@ -122,9 +122,9 @@ impl<'a> GetBans<'a> { } impl IntoFuture for GetBans<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/guild/emoji/get_emojis.rs b/twilight-http/src/request/guild/emoji/get_emojis.rs index 966ed256c6b..ba721c7d0e6 100644 --- a/twilight-http/src/request/guild/emoji/get_emojis.rs +++ b/twilight-http/src/request/guild/emoji/get_emojis.rs @@ -2,7 +2,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -43,9 +43,9 @@ impl<'a> GetEmojis<'a> { } impl IntoFuture for GetEmojis<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/guild/get_guild_channels.rs b/twilight-http/src/request/guild/get_guild_channels.rs index 398f0272299..bbeaf50410e 100644 --- a/twilight-http/src/request/guild/get_guild_channels.rs +++ b/twilight-http/src/request/guild/get_guild_channels.rs @@ -2,7 +2,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -25,9 +25,9 @@ impl<'a> GetGuildChannels<'a> { } impl IntoFuture for GetGuildChannels<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/guild/get_guild_invites.rs b/twilight-http/src/request/guild/get_guild_invites.rs index d39315ffbbb..e66797296b0 100644 --- a/twilight-http/src/request/guild/get_guild_invites.rs +++ b/twilight-http/src/request/guild/get_guild_invites.rs @@ -2,7 +2,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -29,9 +29,9 @@ impl<'a> GetGuildInvites<'a> { } impl IntoFuture for GetGuildInvites<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/guild/get_guild_voice_regions.rs b/twilight-http/src/request/guild/get_guild_voice_regions.rs index cf053a33efb..8c9252bd0a4 100644 --- a/twilight-http/src/request/guild/get_guild_voice_regions.rs +++ b/twilight-http/src/request/guild/get_guild_voice_regions.rs @@ -2,7 +2,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -27,9 +27,9 @@ impl<'a> GetGuildVoiceRegions<'a> { } impl IntoFuture for GetGuildVoiceRegions<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/guild/get_guild_webhooks.rs b/twilight-http/src/request/guild/get_guild_webhooks.rs index 349a409e37e..54ab7d0315c 100644 --- a/twilight-http/src/request/guild/get_guild_webhooks.rs +++ b/twilight-http/src/request/guild/get_guild_webhooks.rs @@ -2,7 +2,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -25,9 +25,9 @@ impl<'a> GetGuildWebhooks<'a> { } impl IntoFuture for GetGuildWebhooks<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/guild/integration/get_guild_integrations.rs b/twilight-http/src/request/guild/integration/get_guild_integrations.rs index 6f613cd87e9..7f465580c42 100644 --- a/twilight-http/src/request/guild/integration/get_guild_integrations.rs +++ b/twilight-http/src/request/guild/integration/get_guild_integrations.rs @@ -2,7 +2,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -28,9 +28,9 @@ impl<'a> GetGuildIntegrations<'a> { } impl IntoFuture for GetGuildIntegrations<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/guild/member/get_guild_members.rs b/twilight-http/src/request/guild/member/get_guild_members.rs index 3a13ba275ee..a8e92196307 100644 --- a/twilight-http/src/request/guild/member/get_guild_members.rs +++ b/twilight-http/src/request/guild/member/get_guild_members.rs @@ -2,7 +2,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -99,9 +99,9 @@ impl<'a> GetGuildMembers<'a> { } impl IntoFuture for GetGuildMembers<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/guild/member/search_guild_members.rs b/twilight-http/src/request/guild/member/search_guild_members.rs index 918f1ae7507..f9fa4f5fe0f 100644 --- a/twilight-http/src/request/guild/member/search_guild_members.rs +++ b/twilight-http/src/request/guild/member/search_guild_members.rs @@ -2,7 +2,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -88,9 +88,9 @@ impl<'a> SearchGuildMembers<'a> { } impl IntoFuture for SearchGuildMembers<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/guild/role/get_guild_roles.rs b/twilight-http/src/request/guild/role/get_guild_roles.rs index 0497626d283..63c94f65507 100644 --- a/twilight-http/src/request/guild/role/get_guild_roles.rs +++ b/twilight-http/src/request/guild/role/get_guild_roles.rs @@ -2,7 +2,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -25,9 +25,9 @@ impl<'a> GetGuildRoles<'a> { } impl IntoFuture for GetGuildRoles<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/guild/role/update_role_positions.rs b/twilight-http/src/request/guild/role/update_role_positions.rs index 51f94d0ec0d..d06dd19af4c 100644 --- a/twilight-http/src/request/guild/role/update_role_positions.rs +++ b/twilight-http/src/request/guild/role/update_role_positions.rs @@ -2,7 +2,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -39,9 +39,9 @@ impl<'a> UpdateRolePositions<'a> { } impl IntoFuture for UpdateRolePositions<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/guild/sticker/get_guild_stickers.rs b/twilight-http/src/request/guild/sticker/get_guild_stickers.rs index ede8a78632f..10484df57b1 100644 --- a/twilight-http/src/request/guild/sticker/get_guild_stickers.rs +++ b/twilight-http/src/request/guild/sticker/get_guild_stickers.rs @@ -2,7 +2,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -24,7 +24,7 @@ use twilight_model::{ /// let client = Client::new("my token".to_owned()); /// /// let guild_id = Id::new(1); -/// let stickers = client.guild_stickers(guild_id).await?.models().await?; +/// let stickers = client.guild_stickers(guild_id).await?.model().await?; /// /// println!("{}", stickers.len()); /// # Ok(()) } @@ -41,9 +41,9 @@ impl<'a> GetGuildStickers<'a> { } impl IntoFuture for GetGuildStickers<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/scheduled_event/get_guild_scheduled_event_users.rs b/twilight-http/src/request/scheduled_event/get_guild_scheduled_event_users.rs index d554514e441..8540f557465 100644 --- a/twilight-http/src/request/scheduled_event/get_guild_scheduled_event_users.rs +++ b/twilight-http/src/request/scheduled_event/get_guild_scheduled_event_users.rs @@ -2,7 +2,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -121,9 +121,9 @@ impl<'a> GetGuildScheduledEventUsers<'a> { } impl IntoFuture for GetGuildScheduledEventUsers<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/scheduled_event/get_guild_scheduled_events.rs b/twilight-http/src/request/scheduled_event/get_guild_scheduled_events.rs index 57422034583..198fa748bad 100644 --- a/twilight-http/src/request/scheduled_event/get_guild_scheduled_events.rs +++ b/twilight-http/src/request/scheduled_event/get_guild_scheduled_events.rs @@ -2,7 +2,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -37,9 +37,9 @@ impl<'a> GetGuildScheduledEvents<'a> { } impl IntoFuture for GetGuildScheduledEvents<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/template/get_templates.rs b/twilight-http/src/request/template/get_templates.rs index be4c5574651..d28472500bb 100644 --- a/twilight-http/src/request/template/get_templates.rs +++ b/twilight-http/src/request/template/get_templates.rs @@ -2,7 +2,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -25,9 +25,9 @@ impl<'a> GetTemplates<'a> { } impl IntoFuture for GetTemplates<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/user/get_current_user_connections.rs b/twilight-http/src/request/user/get_current_user_connections.rs index e320c3e6eaf..e2f7cb7405a 100644 --- a/twilight-http/src/request/user/get_current_user_connections.rs +++ b/twilight-http/src/request/user/get_current_user_connections.rs @@ -2,7 +2,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -23,9 +23,9 @@ impl<'a> GetCurrentUserConnections<'a> { } impl IntoFuture for GetCurrentUserConnections<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/request/user/get_current_user_guilds.rs b/twilight-http/src/request/user/get_current_user_guilds.rs index 4cbf661b393..af67be71303 100644 --- a/twilight-http/src/request/user/get_current_user_guilds.rs +++ b/twilight-http/src/request/user/get_current_user_guilds.rs @@ -2,7 +2,7 @@ use crate::{ client::Client, error::Error, request::{Request, TryIntoRequest}, - response::{marker::ListBody, Response, ResponseFuture}, + response::{Response, ResponseFuture}, routing::Route, }; use std::future::IntoFuture; @@ -106,9 +106,9 @@ impl<'a> GetCurrentUserGuilds<'a> { } impl IntoFuture for GetCurrentUserGuilds<'_> { - type Output = Result>, Error>; + type Output = Result>, Error>; - type IntoFuture = ResponseFuture>; + type IntoFuture = ResponseFuture>; fn into_future(self) -> Self::IntoFuture { let http = self.http; diff --git a/twilight-http/src/response/marker.rs b/twilight-http/src/response/marker.rs index da933cf6cb1..2c506bf72de 100644 --- a/twilight-http/src/response/marker.rs +++ b/twilight-http/src/response/marker.rs @@ -7,8 +7,6 @@ //! [`DeleteRole`]: super::super::request::guild::role::DeleteRole //! [`Response`]: super::Response -use std::marker::PhantomData; - /// Marker that a response has no body. Responses with this marker can't be /// deserialized. /// @@ -20,22 +18,11 @@ use std::marker::PhantomData; #[non_exhaustive] pub struct EmptyBody; -/// Marker that a response has a list of something. -/// -/// May be used via the [`Response::models`]. -/// -/// [`Response::models`]: super::Response::>::models -#[derive(Clone, Debug, Eq, PartialEq)] -pub struct ListBody { - phantom: PhantomData, -} - #[cfg(test)] mod tests { - use super::{EmptyBody, ListBody}; + use super::EmptyBody; use static_assertions::assert_impl_all; use std::fmt::Debug; assert_impl_all!(EmptyBody: Clone, Debug, Eq, PartialEq, Send, Sync); - assert_impl_all!(ListBody: Clone, Debug, Eq, PartialEq, Send, Sync); } diff --git a/twilight-http/src/response/mod.rs b/twilight-http/src/response/mod.rs index be62c848883..4eab6683f37 100644 --- a/twilight-http/src/response/mod.rs +++ b/twilight-http/src/response/mod.rs @@ -52,7 +52,6 @@ mod status_code; pub use self::{future::ResponseFuture, status_code::StatusCode}; -use self::marker::ListBody; use http::{ header::{HeaderValue, Iter as HeaderMapIter}, Response as HyperResponse, @@ -316,39 +315,21 @@ impl Response { pub fn model(self) -> ModelFuture { ModelFuture::new(self.bytes()) } -} -impl Response> { /// Consume the response, chunking the body and then deserializing it into - /// a list of something. - /// - /// This is an alias for [`models`]. + /// the request's matching model. /// /// # Errors /// - /// Returns a [`DeserializeBodyErrorType::Chunking`] error type if the - /// response body could not be entirely read. - /// - /// Returns a [`DeserializeBodyErrorType::Deserializing`] error type if the - /// response body could not be deserialized into a list of something. - /// - /// [`models`]: Self::models - pub fn model(self) -> ModelFuture> { - self.models() - } - - /// Consume the response, chunking the body and then deserializing it into - /// a list of something. - /// - /// # Errors /// /// Returns a [`DeserializeBodyErrorType::Chunking`] error type if the /// response body could not be entirely read. /// /// Returns a [`DeserializeBodyErrorType::Deserializing`] error type if the - /// response body could not be deserialized into a list of something. - pub fn models(self) -> ModelFuture> { - Response::>::new(self.inner).model() + /// response body could not be deserialized into the target model. + #[deprecated(since = "0.15.0", note = "use `model` instead")] + pub fn models(self) -> ModelFuture { + self.model() } } @@ -612,13 +593,12 @@ where #[cfg(test)] mod tests { use super::{ - marker::{EmptyBody, ListBody}, - BytesFuture, DeserializeBodyError, DeserializeBodyErrorType, HeaderIter, ModelFuture, - Response, TextFuture, + marker::EmptyBody, BytesFuture, DeserializeBodyError, DeserializeBodyErrorType, HeaderIter, + ModelFuture, Response, TextFuture, }; use static_assertions::assert_impl_all; use std::{fmt::Debug, future::Future, iter::FusedIterator}; - use twilight_model::{channel::Message, guild::Emoji}; + use twilight_model::guild::Emoji; #[cfg(feature = "decompression")] use std::error::Error; @@ -629,7 +609,6 @@ mod tests { assert_impl_all!(HeaderIter<'_>: Debug, FusedIterator, Iterator, Send, Sync); assert_impl_all!(ModelFuture: Future); assert_impl_all!(Response: Debug, Send, Sync); - assert_impl_all!(Response>: Debug, Send, Sync); assert_impl_all!(TextFuture: Future); #[cfg(feature = "decompression")]