[−][src]Struct serenity::model::guild::Guild
Information about a Discord guild, such as channels, emojis, etc.
Fields
afk_channel_id: Option<ChannelId>
Id of a voice channel that's considered the AFK channel.
afk_timeout: u64
The amount of seconds a user can not show any activity in a voice channel before being moved to an AFK channel -- if one exists.
application_id: Option<ApplicationId>
Application ID of the guild creator if it is bot-created.
channels: HashMap<ChannelId, Arc<RwLock<GuildChannel>>>
All voice and text channels contained within a guild.
This contains all channels regardless of permissions (i.e. the ability of the bot to read from or connect to them).
default_message_notifications: DefaultMessageNotificationLevel
Indicator of whether notifications for all messages are enabled by default in the guild.
emojis: HashMap<EmojiId, Emoji>
All of the guild's custom emojis.
explicit_content_filter: ExplicitContentFilter
Default explicit content filter level.
features: Vec<String>
VIP features enabled for the guild. Can be obtained through the Discord Partnership website.
The following is a list of known features:
INVITE_SPLASH
VANITY_URL
VERIFIED
VIP_REGIONS
icon: Option<String>
The hash of the icon used by the guild.
In the client, this appears on the guild list on the left-hand side.
id: GuildId
The unique Id identifying the guild.
This is equivilant to the Id of the default role (@everyone
) and also
that of the default channel (typically #general
).
joined_at: DateTime<FixedOffset>
The date that the current user joined the guild.
large: bool
Indicator of whether the guild is considered "large" by Discord.
member_count: u64
The number of members in the guild.
members: HashMap<UserId, Member>
Users who are members of the guild.
Members might not all be available when the ReadyEvent
is received
if the member_count
is greater than the LARGE_THRESHOLD
set by
the library.
mfa_level: MfaLevel
Indicator of whether the guild requires multi-factor authentication for
Role
s or User
s with moderation permissions.
name: String
The name of the guild.
owner_id: UserId
The Id of the User
who owns the guild.
presences: HashMap<UserId, Presence>
A mapping of User
s' Ids to their current presences.
region: String
The region that the voice servers that the guild uses are located in.
roles: HashMap<RoleId, Role>
A mapping of the guild's roles.
splash: Option<String>
An identifying hash of the guild's splash icon.
If the ["InviteSplash"
] feature is enabled, this can be used to generate
a URL to a splash image.
system_channel_id: Option<ChannelId>
The ID of the channel to which system messages are sent.
verification_level: VerificationLevel
Indicator of the current verification level of the guild.
voice_states: HashMap<UserId, VoiceState>
A mapping of of User
s to their current voice state.
Methods
impl Guild
[src]
impl Guild
pub fn default_channel(&self, uid: UserId) -> Option<Arc<RwLock<GuildChannel>>>
[src]
pub fn default_channel(&self, uid: UserId) -> Option<Arc<RwLock<GuildChannel>>>
Returns the "default" channel of the guild for the passed user id.
(This returns the first channel that can be read by the user, if there isn't one,
returns None
)
pub fn default_channel_guaranteed(&self) -> Option<Arc<RwLock<GuildChannel>>>
[src]
pub fn default_channel_guaranteed(&self) -> Option<Arc<RwLock<GuildChannel>>>
Returns the guaranteed "default" channel of the guild.
(This returns the first channel that can be read by everyone, if there isn't one,
returns None
)
Note however that this is very costy if used in a server with lots of channels,
members, or both.
pub fn ban<U: Into<UserId>, BO: BanOptions>(
&self,
user: U,
options: &BO
) -> Result<()>
[src]
pub fn ban<U: Into<UserId>, BO: BanOptions>(
&self,
user: U,
options: &BO
) -> Result<()>
Ban a User
from the guild. All messages by the
user within the last given number of days given will be deleted.
Refer to the documentation for Guild::ban
for more information.
Note: Requires the Ban Members permission.
Examples
Ban a member and remove all messages they've sent in the last 4 days:
// assumes a `user` and `guild` have already been bound let _ = guild.ban(user, 4);
Errors
Returns a ModelError::InvalidPermissions
if the current user does
not have permission to perform bans.
Returns a ModelError::DeleteMessageDaysAmount
if the number of
days' worth of messages to delete is over the maximum.
pub fn bans(&self) -> Result<Vec<Ban>>
[src]
pub fn bans(&self) -> Result<Vec<Ban>>
Retrieves a list of Ban
s for the guild.
Note: Requires the Ban Members permission.
Errors
If the cache
is enabled, returns a ModelError::InvalidPermissions
if the current user does not have permission to perform bans.
pub fn audit_logs(
&self,
action_type: Option<u8>,
user_id: Option<UserId>,
before: Option<AuditLogEntryId>,
limit: Option<u8>
) -> Result<AuditLogs>
[src]
pub fn audit_logs(
&self,
action_type: Option<u8>,
user_id: Option<UserId>,
before: Option<AuditLogEntryId>,
limit: Option<u8>
) -> Result<AuditLogs>
Retrieves a list of AuditLogs
for the guild.
pub fn channels(&self) -> Result<HashMap<ChannelId, GuildChannel>>
[src]
pub fn channels(&self) -> Result<HashMap<ChannelId, GuildChannel>>
Gets all of the guild's channels over the REST API.
pub fn create(
name: &str,
region: Region,
icon: Option<&str>
) -> Result<PartialGuild>
[src]
pub fn create(
name: &str,
region: Region,
icon: Option<&str>
) -> Result<PartialGuild>
Creates a guild with the data provided.
Only a PartialGuild
will be immediately returned, and a full
Guild
will be received over a Shard
.
Note: This endpoint is usually only available for user accounts. Refer to Discord's information for the endpoint here for more information. If you require this as a bot, re-think what you are doing and if it really needs to be doing this.
Examples
Create a guild called "test"
in the US West region with no icon:
use serenity::model::{Guild, Region}; let _guild = Guild::create_guild("test", Region::UsWest, None);
pub fn create_channel<C>(
&self,
name: &str,
kind: ChannelType,
category: C
) -> Result<GuildChannel> where
C: Into<Option<ChannelId>>,
[src]
pub fn create_channel<C>(
&self,
name: &str,
kind: ChannelType,
category: C
) -> Result<GuildChannel> where
C: Into<Option<ChannelId>>,
Creates a new Channel
in the guild.
Note: Requires the Manage Channels permission.
Examples
use serenity::model::ChannelType; // assuming a `guild` has already been bound let _ = guild.create_channel("my-test-channel", ChannelType::Text, None);
Errors
If the cache
is enabled, returns a ModelError::InvalidPermissions
if the current user does not have permission to perform bans.
pub fn create_emoji(&self, name: &str, image: &str) -> Result<Emoji>
[src]
pub fn create_emoji(&self, name: &str, image: &str) -> Result<Emoji>
Creates an emoji in the guild with a name and base64-encoded image. The
utils::read_image
function is provided for you as a simple method to
read an image and encode it into base64, if you are reading from the
filesystem.
The name of the emoji must be at least 2 characters long and can only contain alphanumeric characters and underscores.
Requires the Manage Emojis permission.
Examples
See the EditProfile::avatar
example for an in-depth example as to
how to read an image from the filesystem and encode it as base64. Most
of the example can be applied similarly for this method.
pub fn create_integration<I>(&self, integration_id: I, kind: &str) -> Result<()> where
I: Into<IntegrationId>,
[src]
pub fn create_integration<I>(&self, integration_id: I, kind: &str) -> Result<()> where
I: Into<IntegrationId>,
Creates an integration for the guild.
Requires the Manage Guild permission.
pub fn create_role<F>(&self, f: F) -> Result<Role> where
F: FnOnce(EditRole) -> EditRole,
[src]
pub fn create_role<F>(&self, f: F) -> Result<Role> where
F: FnOnce(EditRole) -> EditRole,
Creates a new role in the guild with the data set, if any.
Note: Requires the Manage Roles permission.
Examples
Create a role which can be mentioned, with the name 'test':
// assuming a `guild` has been bound let role = guild.create_role(|r| r.hoist(true).name("role"));
Errors
If the cache
is enabled, returns a ModelError::InvalidPermissions
if the current user does not have permission to perform bans.
pub fn delete(&self) -> Result<PartialGuild>
[src]
pub fn delete(&self) -> Result<PartialGuild>
Deletes the current guild if the current user is the owner of the guild.
Note: Requires the current user to be the owner of the guild.
Errors
If the cache
is enabled, then returns a ModelError::InvalidUser
if the current user is not the guild owner.
pub fn delete_emoji<E: Into<EmojiId>>(&self, emoji_id: E) -> Result<()>
[src]
pub fn delete_emoji<E: Into<EmojiId>>(&self, emoji_id: E) -> Result<()>
Deletes an Emoji
from the guild.
Requires the Manage Emojis permission.
pub fn delete_integration<I: Into<IntegrationId>>(
&self,
integration_id: I
) -> Result<()>
[src]
pub fn delete_integration<I: Into<IntegrationId>>(
&self,
integration_id: I
) -> Result<()>
Deletes an integration by Id from the guild.
Requires the Manage Guild permission.
pub fn delete_role<R: Into<RoleId>>(&self, role_id: R) -> Result<()>
[src]
pub fn delete_role<R: Into<RoleId>>(&self, role_id: R) -> Result<()>
Deletes a Role
by Id from the guild.
Also see Role::delete
if you have the cache
and methods
features
enabled.
Requires the Manage Roles permission.
pub fn edit<F>(&mut self, f: F) -> Result<()> where
F: FnOnce(EditGuild) -> EditGuild,
[src]
pub fn edit<F>(&mut self, f: F) -> Result<()> where
F: FnOnce(EditGuild) -> EditGuild,
Edits the current guild with new data where specified.
Refer to EditGuild
's documentation for a full list of methods.
Note: Requires the current user to have the Manage Guild permission.
Examples
Change a guild's icon using a file name "icon.png":
use serenity::utils; // We are using read_image helper function from utils. let base64_icon = utils::read_image("./icon.png") .expect("Failed to read image"); guild.edit(|g| g.icon(base64_icon));
Errors
If the cache
is enabled, returns a ModelError::InvalidPermissions
if the current user does not have permission to perform bans.
pub fn edit_emoji<E: Into<EmojiId>>(
&self,
emoji_id: E,
name: &str
) -> Result<Emoji>
[src]
pub fn edit_emoji<E: Into<EmojiId>>(
&self,
emoji_id: E,
name: &str
) -> Result<Emoji>
Edits an Emoji
's name in the guild.
Also see Emoji::edit
if you have the cache
and methods
features
enabled.
Requires the Manage Emojis permission.
pub fn edit_member<F, U>(&self, user_id: U, f: F) -> Result<()> where
F: FnOnce(EditMember) -> EditMember,
U: Into<UserId>,
[src]
pub fn edit_member<F, U>(&self, user_id: U, f: F) -> Result<()> where
F: FnOnce(EditMember) -> EditMember,
U: Into<UserId>,
Edits the properties of member of the guild, such as muting or nicknaming them.
Refer to EditMember
's documentation for a full list of methods and
permission restrictions.
Examples
Mute a member and set their roles to just one role with a predefined Id:
guild.edit_member(user_id, |m| m.mute(true).roles(&vec![role_id]));
pub fn edit_nickname(&self, new_nickname: Option<&str>) -> Result<()>
[src]
pub fn edit_nickname(&self, new_nickname: Option<&str>) -> Result<()>
Edits the current user's nickname for the guild.
Pass None
to reset the nickname.
Note: Requires the Change Nickname permission.
Errors
If the cache
is enabled, returns a ModelError::InvalidPermissions
if the current user does not have permission to change their own
nickname.
pub fn edit_role<F, R>(&self, role_id: R, f: F) -> Result<Role> where
F: FnOnce(EditRole) -> EditRole,
R: Into<RoleId>,
[src]
pub fn edit_role<F, R>(&self, role_id: R, f: F) -> Result<Role> where
F: FnOnce(EditRole) -> EditRole,
R: Into<RoleId>,
Edits a role, optionally setting its fields.
Requires the Manage Roles permission.
Examples
Make a role hoisted:
guild.edit_role(RoleId(7), |r| r.hoist(true));
pub fn edit_role_position<R>(
&self,
role_id: R,
position: u64
) -> Result<Vec<Role>> where
R: Into<RoleId>,
[src]
pub fn edit_role_position<R>(
&self,
role_id: R,
position: u64
) -> Result<Vec<Role>> where
R: Into<RoleId>,
Edits the order of Role
s
Requires the Manage Roles permission.
Examples
Change the order of a role:
use serenity::model::RoleId; guild.edit_role_position(RoleId(8), 2);
pub fn get<G: Into<GuildId>>(guild_id: G) -> Result<PartialGuild>
[src]
pub fn get<G: Into<GuildId>>(guild_id: G) -> Result<PartialGuild>
Gets a partial amount of guild data by its Id.
Requires that the current user be in the guild.
pub fn greater_member_hierarchy<T, U>(
&self,
lhs_id: T,
rhs_id: U
) -> Option<UserId> where
T: Into<UserId>,
U: Into<UserId>,
[src]
pub fn greater_member_hierarchy<T, U>(
&self,
lhs_id: T,
rhs_id: U
) -> Option<UserId> where
T: Into<UserId>,
U: Into<UserId>,
Returns which of two User
s has a higher Member
hierarchy.
Hierarchy is essentially who has the Role
with the highest
position
.
Returns None
if at least one of the given users' member instances
is not present. Returns None
if the users have the same hierarchy, as
neither are greater than the other.
If both user IDs are the same, None
is returned. If one of the users
is the guild owner, their ID is returned.
pub fn icon_url(&self) -> Option<String>
[src]
pub fn icon_url(&self) -> Option<String>
Returns the formatted URL of the guild's icon, if one exists.
pub fn integrations(&self) -> Result<Vec<Integration>>
[src]
pub fn integrations(&self) -> Result<Vec<Integration>>
Gets all integration of the guild.
This performs a request over the REST API.
pub fn invites(&self) -> Result<Vec<RichInvite>>
[src]
pub fn invites(&self) -> Result<Vec<RichInvite>>
Retrieves the active invites for the guild.
Note: Requires the Manage Guild permission.
Errors
If the cache
is enabled, returns a ModelError::InvalidPermissions
if the current user does not have permission to perform bans.
pub fn is_large(&self) -> bool
[src]
pub fn is_large(&self) -> bool
Checks if the guild is 'large'. A guild is considered large if it has more than 250 members.
pub fn kick<U: Into<UserId>>(&self, user_id: U) -> Result<()>
[src]
pub fn kick<U: Into<UserId>>(&self, user_id: U) -> Result<()>
Kicks a Member
from the guild.
Requires the Kick Members permission.
pub fn leave(&self) -> Result<()>
[src]
pub fn leave(&self) -> Result<()>
Leaves the guild.
pub fn member<U: Into<UserId>>(&self, user_id: U) -> Result<Member>
[src]
pub fn member<U: Into<UserId>>(&self, user_id: U) -> Result<Member>
Gets a user's Member
for the guild by Id.
pub fn members<U>(
&self,
limit: Option<u64>,
after: Option<U>
) -> Result<Vec<Member>> where
U: Into<UserId>,
[src]
pub fn members<U>(
&self,
limit: Option<u64>,
after: Option<U>
) -> Result<Vec<Member>> where
U: Into<UserId>,
Gets a list of the guild's members.
Optionally pass in the limit
to limit the number of results. Maximum
value is 1000. Optionally pass in after
to offset the results by a
User
's Id.
pub fn members_with_status(&self, status: OnlineStatus) -> Vec<&Member>
[src]
pub fn members_with_status(&self, status: OnlineStatus) -> Vec<&Member>
Gets a list of all the members (satisfying the status provided to the function) in this guild.
pub fn member_named(&self, name: &str) -> Option<&Member>
[src]
pub fn member_named(&self, name: &str) -> Option<&Member>
Retrieves the first Member
found that matches the name - with an
optional discriminator - provided.
Searching with a discriminator given is the most precise form of lookup, as no two people can share the same username and discriminator.
If a member can not be found by username or username#discriminator,
then a search will be done for the nickname. When searching by nickname,
the hash (#
) and everything after it is included in the search.
The following are valid types of searches:
- username: "zey"
- username and discriminator: "zey#5479"
pub fn members_starting_with(
&self,
prefix: &str,
case_sensitive: bool,
sorted: bool
) -> Vec<&Member>
[src]
pub fn members_starting_with(
&self,
prefix: &str,
case_sensitive: bool,
sorted: bool
) -> Vec<&Member>
Retrieves all Member
that start with a given String
.
sorted
decides whether the best early match of the prefix
should be the criteria to sort the result.
For the prefix
"zey" and the unsorted result:
- "zeya", "zeyaa", "zeyla", "zeyzey", "zeyzeyzey" It would be sorted:
- "zeya", "zeyaa", "zeyla", "zeyzey", "zeyzeyzey"
pub fn members_containing(
&self,
substring: &str,
case_sensitive: bool,
sorted: bool
) -> Vec<&Member>
[src]
pub fn members_containing(
&self,
substring: &str,
case_sensitive: bool,
sorted: bool
) -> Vec<&Member>
Retrieves all Member
containing a given String
as
either username or nick, with a priority on username.
If the substring is "yla", following results are possible:
- "zeyla", "meiyla", "yladenisyla" If 'case_sensitive' is false, the following are not found:
- "zeYLa", "meiyLa", "LYAdenislyA"
sorted
decides whether the best early match of the search-term
should be the criteria to sort the result.
It will look at the account name first, if that does not fit the
search-criteria substring
, the display-name will be considered.
For the substring
"zey" and the unsorted result:
- "azey", "zey", "zeyla", "zeylaa", "zeyzeyzey" It would be sorted:
- "zey", "azey", "zeyla", "zeylaa", "zeyzeyzey"
Note: Due to two fields of a Member
being candidates for
the searched field, setting sorted
to true
will result in an overhead,
as both fields have to be considered again for sorting.
pub fn members_username_containing(
&self,
substring: &str,
case_sensitive: bool,
sorted: bool
) -> Vec<&Member>
[src]
pub fn members_username_containing(
&self,
substring: &str,
case_sensitive: bool,
sorted: bool
) -> Vec<&Member>
Retrieves all Member
containing a given String
in
their username.
If the substring is "yla", following results are possible:
- "zeyla", "meiyla", "yladenisyla" If 'case_sensitive' is false, the following are not found:
- "zeYLa", "meiyLa", "LYAdenislyA"
sort
decides whether the best early match of the search-term
should be the criteria to sort the result.
For the substring
"zey" and the unsorted result:
- "azey", "zey", "zeyla", "zeylaa", "zeyzeyzey" It would be sorted:
- "zey", "azey", "zeyla", "zeylaa", "zeyzeyzey"
pub fn members_nick_containing(
&self,
substring: &str,
case_sensitive: bool,
sorted: bool
) -> Vec<&Member>
[src]
pub fn members_nick_containing(
&self,
substring: &str,
case_sensitive: bool,
sorted: bool
) -> Vec<&Member>
Retrieves all Member
containing a given String
in
their nick.
If the substring is "yla", following results are possible:
- "zeyla", "meiyla", "yladenisyla" If 'case_sensitive' is false, the following are not found:
- "zeYLa", "meiyLa", "LYAdenislyA"
sort
decides whether the best early match of the search-term
should be the criteria to sort the result.
For the substring
"zey" and the unsorted result:
- "azey", "zey", "zeyla", "zeylaa", "zeyzeyzey" It would be sorted:
- "zey", "azey", "zeyla", "zeylaa", "zeyzeyzey"
Note: Instead of panicing, when sorting does not find a nick, the username will be used (this should never happen).
pub fn member_permissions<U>(&self, user_id: U) -> Permissions where
U: Into<UserId>,
[src]
pub fn member_permissions<U>(&self, user_id: U) -> Permissions where
U: Into<UserId>,
Calculate a Member
's permissions in the guild.
pub fn move_member<C, U>(&self, user_id: U, channel_id: C) -> Result<()> where
C: Into<ChannelId>,
U: Into<UserId>,
[src]
pub fn move_member<C, U>(&self, user_id: U, channel_id: C) -> Result<()> where
C: Into<ChannelId>,
U: Into<UserId>,
Moves a member to a specific voice channel.
Requires the Move Members permission.
pub fn permissions_for<C, U>(&self, channel_id: C, user_id: U) -> Permissions where
C: Into<ChannelId>,
U: Into<UserId>,
[src]
pub fn permissions_for<C, U>(&self, channel_id: C, user_id: U) -> Permissions where
C: Into<ChannelId>,
U: Into<UserId>,
: This will serve a different purpose in 0.5
Alias for permissions_in
.
pub fn permissions_in<C, U>(&self, channel_id: C, user_id: U) -> Permissions where
C: Into<ChannelId>,
U: Into<UserId>,
[src]
pub fn permissions_in<C, U>(&self, channel_id: C, user_id: U) -> Permissions where
C: Into<ChannelId>,
U: Into<UserId>,
Calculate a User
's permissions in a given channel in the guild.
pub fn prune_count(&self, days: u16) -> Result<GuildPrune>
[src]
pub fn prune_count(&self, days: u16) -> Result<GuildPrune>
Retrieves the count of the number of Member
s that would be pruned
with the number of given days.
See the documentation on GuildPrune
for more information.
Note: Requires the Kick Members permission.
Errors
If the cache
is enabled, returns a ModelError::InvalidPermissions
if the current user does not have permission to perform bans.
pub fn reorder_channels<It>(&self, channels: It) -> Result<()> where
It: IntoIterator<Item = (ChannelId, u64)>,
[src]
pub fn reorder_channels<It>(&self, channels: It) -> Result<()> where
It: IntoIterator<Item = (ChannelId, u64)>,
Re-orders the channels of the guild.
Although not required, you should specify all channels' positions, regardless of whether they were updated. Otherwise, positioning can sometimes get weird.
Returns the Id of the shard associated with the guild.
When the cache is enabled this will automatically retrieve the total number of shards.
Note: When the cache is enabled, this function unlocks the cache to
retrieve the total number of shards in use. If you already have the
total, consider using utils::shard_id
.
pub fn splash_url(&self) -> Option<String>
[src]
pub fn splash_url(&self) -> Option<String>
Returns the formatted URL of the guild's splash image, if one exists.
pub fn start_integration_sync<I: Into<IntegrationId>>(
&self,
integration_id: I
) -> Result<()>
[src]
pub fn start_integration_sync<I: Into<IntegrationId>>(
&self,
integration_id: I
) -> Result<()>
Starts an integration sync for the given integration Id.
Requires the Manage Guild permission.
pub fn start_prune(&self, days: u16) -> Result<GuildPrune>
[src]
pub fn start_prune(&self, days: u16) -> Result<GuildPrune>
Starts a prune of Member
s.
See the documentation on GuildPrune
for more information.
Note: Requires the Kick Members permission.
Errors
If the cache
is enabled, returns a ModelError::InvalidPermissions
if the current user does not have permission to perform bans.
pub fn unban<U: Into<UserId>>(&self, user_id: U) -> Result<()>
[src]
pub fn unban<U: Into<UserId>>(&self, user_id: U) -> Result<()>
Unbans the given User
from the guild.
Note: Requires the Ban Members permission.
Errors
If the cache
is enabled, returns a ModelError::InvalidPermissions
if the current user does not have permission to perform bans.
pub fn vanity_url(&self) -> Result<String>
[src]
pub fn vanity_url(&self) -> Result<String>
Retrieve's the guild's vanity URL.
Note: Requires the Manage Guild permission.
pub fn webhooks(&self) -> Result<Vec<Webhook>>
[src]
pub fn webhooks(&self) -> Result<Vec<Webhook>>
Retrieves the guild's webhooks.
Note: Requires the Manage Webhooks permission.
pub fn role_by_name(&self, role_name: &str) -> Option<&Role>
[src]
pub fn role_by_name(&self, role_name: &str) -> Option<&Role>
Obtain a reference to a role by its name.
Note: If two or more roles have the same name, obtained reference will be one of them.
Examples
Obtain a reference to a Role
by its name.
use serenity::model::prelude::*; use serenity::prelude::*; struct Handler; use serenity::CACHE; impl EventHandler for Handler { fn message(&self, _: Context, msg: Message) { if let Some(arc) = msg.guild_id().unwrap().to_guild_cached() { if let Some(role) = arc.read().role_by_name("role_name") { println!("{:?}", role); } } } } let mut client = Client::new("token", Handler).unwrap(); client.start().unwrap();
Trait Implementations
impl From<Guild> for GuildId
[src]
impl From<Guild> for GuildId
impl<'a> From<&'a Guild> for GuildId
[src]
impl<'a> From<&'a Guild> for GuildId
impl Clone for Guild
[src]
impl Clone for Guild
fn clone(&self) -> Guild
[src]
fn clone(&self) -> Guild
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl Debug for Guild
[src]
impl Debug for Guild
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Serialize for Guild
[src]
impl Serialize for Guild
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'de> Deserialize<'de> for Guild
[src]
impl<'de> Deserialize<'de> for Guild
fn deserialize<D: Deserializer<'de>>(
deserializer: D
) -> StdResult<Self, D::Error>
[src]
fn deserialize<D: Deserializer<'de>>(
deserializer: D
) -> StdResult<Self, D::Error>
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
type Owned = T
fn to_owned(&self) -> T
[src]
fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
fn clone_into(&self, target: &mut T)
[src]
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
impl<T> Erased for T
impl<T> Erased for T
impl<T> Typeable for T where
T: Any,
impl<T> Typeable for T where
T: Any,
impl<T> DebugAny for T where
T: Any + Debug,
[src]
impl<T> DebugAny for T where
T: Any + Debug,
impl<T> CloneAny for T where
T: Clone + Any,
[src]
impl<T> CloneAny for T where
T: Clone + Any,
fn clone_any(&self) -> Box<dyn CloneAny + 'static>
[src]
fn clone_any(&self) -> Box<dyn CloneAny + 'static>
fn clone_any_send(&self) -> Box<dyn CloneAny + 'static + Send> where
T: Send,
[src]
fn clone_any_send(&self) -> Box<dyn CloneAny + 'static + Send> where
T: Send,
fn clone_any_sync(&self) -> Box<dyn CloneAny + 'static + Sync> where
T: Sync,
[src]
fn clone_any_sync(&self) -> Box<dyn CloneAny + 'static + Sync> where
T: Sync,
fn clone_any_send_sync(&self) -> Box<dyn CloneAny + 'static + Sync + Send> where
T: Send + Sync,
[src]
fn clone_any_send_sync(&self) -> Box<dyn CloneAny + 'static + Sync + Send> where
T: Send + Sync,
impl<T> UnsafeAny for T where
T: Any,
impl<T> UnsafeAny for T where
T: Any,