pub struct Events {
pub raw: Option<fn(_: LavalinkClient, session_id: String, _: &Value) -> BoxFuture<'_, ()>>,
pub ready: Option<fn(_: LavalinkClient, session_id: String, _: &Ready) -> BoxFuture<'_, ()>>,
pub player_update: Option<fn(_: LavalinkClient, session_id: String, _: &PlayerUpdate) -> BoxFuture<'_, ()>>,
pub stats: Option<fn(_: LavalinkClient, session_id: String, _: &Stats) -> BoxFuture<'_, ()>>,
pub track_start: Option<fn(_: LavalinkClient, session_id: String, _: &TrackStart) -> BoxFuture<'_, ()>>,
pub track_end: Option<fn(_: LavalinkClient, session_id: String, _: &TrackEnd) -> BoxFuture<'_, ()>>,
pub track_exception: Option<fn(_: LavalinkClient, session_id: String, _: &TrackException) -> BoxFuture<'_, ()>>,
pub track_stuck: Option<fn(_: LavalinkClient, session_id: String, _: &TrackStuck) -> BoxFuture<'_, ()>>,
pub websocket_closed: Option<fn(_: LavalinkClient, session_id: String, _: &WebSocketClosed) -> BoxFuture<'_, ()>>,
/* private fields */
}
Fields§
§raw: Option<fn(_: LavalinkClient, session_id: String, _: &Value) -> BoxFuture<'_, ()>>
Every single event will trigger this event with the raw data received.
ready: Option<fn(_: LavalinkClient, session_id: String, _: &Ready) -> BoxFuture<'_, ()>>
Dispatched by Lavalink upon successful connection and authorization.
player_update: Option<fn(_: LavalinkClient, session_id: String, _: &PlayerUpdate) -> BoxFuture<'_, ()>>
Dispatched periodically with the current state of a player.
stats: Option<fn(_: LavalinkClient, session_id: String, _: &Stats) -> BoxFuture<'_, ()>>
A collection of statistics sent every minute.
track_start: Option<fn(_: LavalinkClient, session_id: String, _: &TrackStart) -> BoxFuture<'_, ()>>
Dispatched when a track starts playing.
track_end: Option<fn(_: LavalinkClient, session_id: String, _: &TrackEnd) -> BoxFuture<'_, ()>>
Dispatched when a track ends. track_exception and track_stuck will also trigger this event.
track_exception: Option<fn(_: LavalinkClient, session_id: String, _: &TrackException) -> BoxFuture<'_, ()>>
Dispatched when a track throws an exception.
track_stuck: Option<fn(_: LavalinkClient, session_id: String, _: &TrackStuck) -> BoxFuture<'_, ()>>
Dispatched when a track gets stuck while playing.
websocket_closed: Option<fn(_: LavalinkClient, session_id: String, _: &WebSocketClosed) -> BoxFuture<'_, ()>>
Dispatched when an audio WebSocket to Discord is closed.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Events
impl !RefUnwindSafe for Events
impl Send for Events
impl Sync for Events
impl Unpin for Events
impl UnwindSafe for Events
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