[−][src]Struct serenity::model::channel::ChannelCategory
A category of GuildChannel
s.
Fields
id: ChannelId
Id of this category.
category_id: Option<ChannelId>
If this category belongs to another category.
position: i64
The position of this category.
kind: ChannelType
Indicator of the type of channel this is.
This should always be ChannelType::Category
.
name: String
The name of the category.
nsfw: bool
Whether this category is nsfw. (This'll be inherited by all channels in this category)
permission_overwrites: Vec<PermissionOverwrite>
Permission overwrites for the GuildChannel
s.
Methods
impl ChannelCategory
[src]
pub fn create_permission(
&self,
http: impl AsRef<Http>,
target: &PermissionOverwrite
) -> Result<()>
[src]
&self,
http: impl AsRef<Http>,
target: &PermissionOverwrite
) -> Result<()>
Adds a permission overwrite to the category's channels.
pub fn delete_permission(
&self,
http: impl AsRef<Http>,
permission_type: PermissionOverwriteType
) -> Result<()>
[src]
&self,
http: impl AsRef<Http>,
permission_type: PermissionOverwriteType
) -> Result<()>
Deletes all permission overrides in the category from the channels.
Note: Requires the Manage Channel permission.
pub fn delete(&self, cache_http: impl CacheHttp) -> Result<()>
[src]
Deletes this category if required permissions are met.
Note: If the cache
-feature is enabled permissions will be checked and upon
owning the required permissions the HTTP-request will be issued.
pub fn edit<F>(&mut self, cache_http: impl CacheHttp, f: F) -> Result<()> where
F: FnOnce(&mut EditChannel) -> &mut EditChannel,
[src]
F: FnOnce(&mut EditChannel) -> &mut EditChannel,
Modifies the category's settings, such as its position or name.
Refer to EditChannel
s documentation for a full list of methods.
Examples
Change a voice channels name and bitrate:
category.edit(&context, |c| c.name("test").bitrate(86400));
pub fn is_nsfw(&self) -> bool
[src]
pub fn name(&self) -> &str
[src]
Returns the name of the category.
Trait Implementations
impl Mentionable for ChannelCategory
[src]
impl Clone for ChannelCategory
[src]
fn clone(&self) -> ChannelCategory
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for ChannelCategory
[src]
impl Serialize for ChannelCategory
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl<'de> Deserialize<'de> for ChannelCategory
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
Auto Trait Implementations
impl Sync for ChannelCategory
impl Send for ChannelCategory
impl Unpin for ChannelCategory
impl RefUnwindSafe for ChannelCategory
impl UnwindSafe for ChannelCategory
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> Erased for T
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
U: TryFrom<T>,
impl<T> DebugAny for T where
T: Any + Debug,
[src]
T: Any + Debug,
impl<T> CloneAny for T where
T: Clone + Any,
[src]
T: Clone + Any,
fn clone_any(&self) -> Box<dyn CloneAny + 'static>
[src]
fn clone_any_send(&self) -> Box<dyn CloneAny + 'static + Send> where
T: Send,
[src]
T: Send,
fn clone_any_sync(&self) -> Box<dyn CloneAny + 'static + Sync> where
T: Sync,
[src]
T: Sync,
fn clone_any_send_sync(&self) -> Box<dyn CloneAny + 'static + Send + Sync> where
T: Send + Sync,
[src]
T: Send + Sync,
impl<T> UnsafeAny for T where
T: Any,
T: Any,