[−][src]Struct twilight_lavalink::player::Player
A player for a guild connected to a node.
This can be used to send events over a node and to read the details of a player for a guild.
Implementations
impl Player
[src]
pub fn send(
&self,
event: impl Into<OutgoingEvent>
) -> Result<(), TrySendError<OutgoingEvent>>
[src]
&self,
event: impl Into<OutgoingEvent>
) -> Result<(), TrySendError<OutgoingEvent>>
Send an event to the player's node.
Returns a futures_channel
TrySendError
if the node has been removed.
Examples
use twilight_lavalink::{model::{Play, Pause}, Lavalink}; let lavalink = Lavalink::new(user_id, 10); let players = lavalink.players(); if let Some(player) = players.get(&guild_id) { player.send(Play::from((guild_id, track)))?; player.send(Pause::from((guild_id, true)))?; }
pub fn node(&self) -> &Node
[src]
Return an immutable reference to the node linked to the player.
pub fn channel_id(&self) -> Option<ChannelId>
[src]
Return a copy of the player's channel ID.
pub fn guild_id(&self) -> GuildId
[src]
Return an copy of the player's guild ID.
pub fn paused(&self) -> bool
[src]
Return a copy of whether the player is paused.
pub fn position(&self) -> i64
[src]
Return a copy of the player's position.
pub fn time_ref(&mut self) -> i64
[src]
Return a copy of the player's time.
pub fn volume_ref(&self) -> u16
[src]
Return a copy of the player's volume.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Player
[src]
impl Send for Player
[src]
impl Sync for Player
[src]
impl Unpin for Player
[src]
impl !UnwindSafe for Player
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
type Output = T
Should always be Self
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.
pub 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.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,