pub struct Options<S, A, Fut>where
    A: TryInto<ServerAddress>,
    Fut: Future<Output = Result<(), Error>>,
{ pub address: A, pub account: Account, pub plugins: Vec<Box<dyn Plugin>>, pub state: S, pub handle: HandleFn<Fut, S>, }
Expand description

The options that are passed to azalea::start.

Fields

address: A

The address of the server that we’re connecting to. This can be a &str, ServerAddress, or anything that implements TryInto<ServerAddress>.

account: Account

The account that’s going to join the server,

plugins: Vec<Box<dyn Plugin>>

A list of plugins that are going to be used. Plugins are external crates that add extra functionality to Azalea.

state: S

A struct that contains the data that you want your bot to remember across events.

Examples

use parking_lot::Mutex;
use std::sync::Arc;

#[derive(Default, Clone)]
struct State {
    farming: Arc<Mutex<bool>>,
}
handle: HandleFn<Fut, S>

The function that’s called whenever we get an event.

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