pub struct PlayerManager { /* private fields */ }
Expand description
Retrieve and create players for guilds.
The player manager contains all of the players for all guilds over all nodes, and can be used to read player information and send events to nodes.
Implementations§
Source§impl PlayerManager
impl PlayerManager
Sourcepub fn get(&self, guild_id: &Id<GuildMarker>) -> Option<Arc<Player>>
pub fn get(&self, guild_id: &Id<GuildMarker>) -> Option<Arc<Player>>
Return an immutable reference to a player by guild ID.
Sourcepub fn get_or_insert(
&self,
guild_id: Id<GuildMarker>,
node: Arc<Node>,
) -> Arc<Player>
pub fn get_or_insert( &self, guild_id: Id<GuildMarker>, node: Arc<Node>, ) -> Arc<Player>
Return a mutable reference to a player by guild ID or insert a new player linked to a given node.
Sourcepub fn destroy(&self, guild_id: Id<GuildMarker>) -> Result<(), NodeSenderError>
pub fn destroy(&self, guild_id: Id<GuildMarker>) -> Result<(), NodeSenderError>
Destroy a player on the remote node and remove it from the PlayerManager
.
§Errors
Returns a NodeSenderErrorType::Sending
error type if node is no
longer connected.
Trait Implementations§
Source§impl Clone for PlayerManager
impl Clone for PlayerManager
Source§fn clone(&self) -> PlayerManager
fn clone(&self) -> PlayerManager
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PlayerManager
impl Debug for PlayerManager
Source§impl Default for PlayerManager
impl Default for PlayerManager
Source§fn default() -> PlayerManager
fn default() -> PlayerManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PlayerManager
impl !RefUnwindSafe for PlayerManager
impl Send for PlayerManager
impl Sync for PlayerManager
impl Unpin for PlayerManager
impl !UnwindSafe for PlayerManager
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more