pub struct Player {
pub guild_id: String,
pub paused: Arc<AtomicBool>,
pub volume: Arc<AtomicU32>,
pub mixer: Shared<Mixer>,
pub filter_chain: Shared<FilterChain>,
pub voice_gateway_cancel: Arc<Mutex<Option<CancellationToken>>>,
pub track_handle: Arc<Mutex<Option<TrackHandle>>>,
pub event_sender: Arc<Mutex<Option<EventSender>>>,
}Fields§
§guild_id: String§paused: Arc<AtomicBool>§volume: Arc<AtomicU32>§mixer: Shared<Mixer>§filter_chain: Shared<FilterChain>§voice_gateway_cancel: Arc<Mutex<Option<CancellationToken>>>§track_handle: Arc<Mutex<Option<TrackHandle>>>§event_sender: Arc<Mutex<Option<EventSender>>>Implementations§
Source§impl Player
impl Player
pub fn new(guild_id: String) -> Self
pub async fn play<F>( &self, user_id: String, channel_id: String, session_id: String, token: String, endpoint: String, url: String, callback: F, ) -> Result<(), String>
pub async fn pause(&self)
pub async fn resume(&self)
pub async fn stop(&self)
pub async fn seek(&self, position_ms: i64)
pub async fn set_volume(&self, volume: f64)
pub fn get_position(&self) -> i64
pub fn is_paused(&self) -> bool
pub async fn set_filters(&self, filters_json: String) -> Result<(), String>
Auto Trait Implementations§
impl !RefUnwindSafe for Player
impl !UnwindSafe for Player
impl Freeze for Player
impl Send for Player
impl Sync for Player
impl Unpin for Player
impl UnsafeUnpin for Player
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Declassify for T
impl<T> Declassify for T
type Declassified = T
fn declassify(self) -> T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more