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
impl<S, A, Fut> !RefUnwindSafe for Options<S, A, Fut>
impl<S, A, Fut> Send for Options<S, A, Fut>where
A: Send,
S: Send,
impl<S, A, Fut> Sync for Options<S, A, Fut>where
A: Sync,
S: Sync,
impl<S, A, Fut> Unpin for Options<S, A, Fut>where
A: Unpin,
S: Unpin,
impl<S, A, Fut> !UnwindSafe for Options<S, A, Fut>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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