Function azalea::start

source · []
pub async fn start<S: Send + Sync + Clone + 'static, A: Send + TryInto<ServerAddress>, Fut: Future<Output = Result<(), Error>> + Send + 'static>(
    options: Options<S, A, Fut>
) -> Result<(), Error>
Expand description

Join a server and start handling events. This function will run forever until it gets disconnected from the server.

Examples

let error = azalea::start(azalea::Options {
    account,
    address: "localhost",
    state: State::default(),
    plugins: vec![Box::new(autoeat::Plugin::default())],
    handle,
}).await;