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

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.

Errors

Returns an error of type Connecting if the connection fails after several backoff attempts.

Returns an error of type BuildingConnectionRequest if the request failed to build.

Returns an error of type Unauthorized if the supplied authorization is rejected by the node.

Retrieve an immutable reference to the node’s configuration.

Retrieve an immutable reference to the player manager used by the node.

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.

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.

Retrieve a copy of the node’s stats.

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

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

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

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

Calls U::from(self).

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

Should always be Self

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

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

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