Struct sparkle_cache::model::CachedRole
source · [−]pub struct CachedRole {Show 13 fields
pub guild_id: Id<GuildMarker>,
pub user_id: Option<Id<UserMarker>>,
pub color: u32,
pub hoist: bool,
pub icon: Option<ImageHash>,
pub id: Id<RoleMarker>,
pub managed: bool,
pub mentionable: bool,
pub name: String,
pub permissions: Permissions,
pub position: i64,
pub tags: Option<RoleTags>,
pub unicode_emoji: Option<String>,
}Expand description
A cached emoji
It’s the same as twilight_model::guild::Role except:
-
guild_idfield is added, making it possible to return a guild’s roles -
user_idfield is added, making it possible to return a member’s roles
Fields
guild_id: Id<GuildMarker>user_id: Option<Id<UserMarker>>color: u32hoist: boolicon: Option<ImageHash>id: Id<RoleMarker>managed: boolmentionable: boolname: Stringpermissions: Permissionsposition: i64unicode_emoji: Option<String>Implementations
sourceimpl CachedRole
impl CachedRole
sourcepub fn from_role(role: Role, guild_id: Id<GuildMarker>) -> Self
pub fn from_role(role: Role, guild_id: Id<GuildMarker>) -> Self
Create a cached role from a given role and guild ID
Trait Implementations
sourceimpl Clone for CachedRole
impl Clone for CachedRole
sourcefn clone(&self) -> CachedRole
fn clone(&self) -> CachedRole
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations
impl RefUnwindSafe for CachedRole
impl Send for CachedRole
impl Sync for CachedRole
impl Unpin for CachedRole
impl UnwindSafe for CachedRole
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more