#[non_exhaustive]pub struct NodeConfig {
pub address: SocketAddr,
pub authorization: String,
pub resume: Option<Resume>,
pub user_id: Id<UserMarker>,
}
Expand description
The configuration that a Node
uses to connect to a Lavalink server.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.address: SocketAddr
The address of the node.
The password to use when authenticating.
resume: Option<Resume>
The details for resuming a Lavalink session, if any.
Set this to None
to disable resume capability.
user_id: Id<UserMarker>
The user ID of the bot.
Implementations§
Source§impl NodeConfig
impl NodeConfig
Sourcepub fn new(
user_id: Id<UserMarker>,
address: impl Into<SocketAddr>,
authorization: impl Into<String>,
resume: impl Into<Option<Resume>>,
) -> Self
pub fn new( user_id: Id<UserMarker>, address: impl Into<SocketAddr>, authorization: impl Into<String>, resume: impl Into<Option<Resume>>, ) -> Self
Create a new configuration for connecting to a node via
Node::connect
.
If adding a node through the Lavalink
client then you don’t need to
do this yourself.
Trait Implementations§
Source§impl Clone for NodeConfig
impl Clone for NodeConfig
Source§fn clone(&self) -> NodeConfig
fn clone(&self) -> NodeConfig
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for NodeConfig
impl Debug for NodeConfig
Source§impl PartialEq for NodeConfig
impl PartialEq for NodeConfig
impl Eq for NodeConfig
impl StructuralPartialEq for NodeConfig
Auto Trait Implementations§
impl Freeze for NodeConfig
impl RefUnwindSafe for NodeConfig
impl Send for NodeConfig
impl Sync for NodeConfig
impl Unpin for NodeConfig
impl UnwindSafe for NodeConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more