Struct twilight_lavalink::node::Node
source · [−]pub struct Node { /* private fields */ }
Expand description
A connection to a single Lavalink server. It receives events and forwards events from players to the server.
Please refer to the module documentation.
Implementations
sourceimpl Node
impl Node
sourcepub async fn connect(
config: NodeConfig,
players: PlayerManager
) -> Result<(Self, IncomingEvents), NodeError>
pub async fn connect(
config: NodeConfig,
players: PlayerManager
) -> Result<(Self, IncomingEvents), NodeError>
sourcepub const fn config(&self) -> &NodeConfig
pub const fn config(&self) -> &NodeConfig
Retrieve an immutable reference to the node’s configuration.
sourcepub const fn players(&self) -> &PlayerManager
pub const fn players(&self) -> &PlayerManager
Retrieve an immutable reference to the player manager used by the node.
sourcepub fn send(&self, event: OutgoingEvent) -> Result<(), NodeSenderError>
pub fn send(&self, event: OutgoingEvent) -> Result<(), NodeSenderError>
Retrieve an immutable reference to the node’s configuration.
Note that sending player events through the node’s sender won’t update player states, such as whether it’s paused.
Errors
Returns a NodeSenderErrorType::Sending
error type if node is no
longer connected.
sourcepub fn sender(&self) -> NodeSender
pub fn sender(&self) -> NodeSender
Retrieve a unique sender to send events to the Lavalink server.
Note that sending player events through the node’s sender won’t update player states, such as whether it’s paused.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Node
impl Send for Node
impl Sync for Node
impl Unpin for Node
impl !UnwindSafe for Node
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
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
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more