[−][src]Struct twilight_lavalink::node::Node
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
impl Node
[src]
pub async fn connect(
config: NodeConfig,
players: PlayerManager
) -> Result<(Self, UnboundedReceiver<IncomingEvent>), NodeError>
[src]
config: NodeConfig,
players: PlayerManager
) -> Result<(Self, UnboundedReceiver<IncomingEvent>), NodeError>
Connect to a node, providing a player manager so that the node can update player details.
Please refer to the module documentation for some additional
information about directly creating and using nodes. You are encouraged
to use the Lavalink
client instead.
pub fn config(&self) -> &NodeConfig
[src]
Retrieve an immutable reference to the node's configuration.
pub async fn players(&self) -> &PlayerManager
[src]
Retrieve an immutable reference to the player manager used by the node.
pub fn send(
&self,
event: OutgoingEvent
) -> Result<(), TrySendError<OutgoingEvent>>
[src]
&self,
event: OutgoingEvent
) -> Result<(), TrySendError<OutgoingEvent>>
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.
pub fn sender(&self) -> UnboundedSender<OutgoingEvent>
[src]
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.
pub async fn stats(&self) -> Stats
[src]
Retrieve a copy of the node's stats.
pub async fn penalty(&self) -> i32
[src]
Retrieve the calculated penalty score of the node.
This score can be used to calculate how loaded the server is. A higher number means it is more heavily loaded.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Node
[src]
impl Send for Node
[src]
impl Sync for Node
[src]
impl Unpin for Node
[src]
impl !UnwindSafe for Node
[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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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>,