PlayerObject

Struct PlayerObject 

Source
pub struct PlayerObject { /* private fields */ }
Expand description

Represents an instance in a voice channel

Implementations§

Source§

impl PlayerObject

Source

pub async fn register_event_handler( &mut self, event_handler: impl CharcoalEventHandler + Send + 'static, )

Register an error callback that will be called if an error occurs on this PlayerObject

Source§

impl PlayerObject

Source

pub async fn new( guild_id: String, com_tx: Sender<IPCData>, ) -> Result<Self, CreateJobError>

Creates a new Player Object that can then be joined to channel and used to playback audio

Trait Implementations§

Source§

impl ChannelManager for PlayerObject

Source§

fn join_channel<'life0, 'async_trait>( &'life0 mut self, voice_channel_id: String, create_job: bool, ) -> Pin<Box<dyn Future<Output = Result<(), CreateJobError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Create job on Hearth server for this PlayerObject

Source§

fn exit_channel<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), ChannelManagerError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Exit voice channel

Source§

impl Player for PlayerObject

Source§

fn play_from_http<'life0, 'async_trait>( &'life0 mut self, url: String, ) -> Pin<Box<dyn Future<Output = Result<(), PlayerActionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Play from an HTTP URL
Source§

fn play_from_youtube<'life0, 'async_trait>( &'life0 mut self, url: String, ) -> Pin<Box<dyn Future<Output = Result<(), PlayerActionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Play from a Youtube URL
Source§

impl TrackManager for PlayerObject

Source§

fn set_playback_volume<'life0, 'async_trait>( &'life0 self, playback_volume: f32, ) -> Pin<Box<dyn Future<Output = Result<(), TrackActionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Set playback volume
Source§

fn force_stop_loop<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), TrackActionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Stop looping
Source§

fn loop_indefinitely<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), TrackActionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Loop forever
Source§

fn loop_x_times<'life0, 'async_trait>( &'life0 self, times: usize, ) -> Pin<Box<dyn Future<Output = Result<(), TrackActionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Loop X amount of times
Source§

fn seek_to_position<'life0, 'async_trait>( &'life0 self, position: Duration, ) -> Pin<Box<dyn Future<Output = Result<(), TrackActionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Seek to position on track from start
Source§

fn resume_playback<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), TrackActionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Resume playback
Source§

fn pause_playback<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<(), TrackActionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Pause playback
Source§

fn get_metadata<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<(), TrackActionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get metadata for track currently being played

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,