The current ClientBuilder implementation fails to compile unless a handler function and state are specified due to the generic values S and Fut of ClientBuilder being unable to resolve. This PR adds placeholder entries and a corresponding no_handler() function for ClientBuilder that allows for a more straightforward implementation when using an exclusively ECS-based codebase.
#[tokio::main]
async fn main() {
let account = Account::offline("bot");
let e = ClientBuilder::new()
.no_handler()
.add_plugins(...)
.start(account.clone(), "localhost")
.await;
eprintln!("{:?}", e);
}
Note that EmptyState and EmptyFuture must still be public for the code to compile, so I wrapped those in their own module. If needed, they can also be moved to a separate file, but I left them in the lib.rs file so they would remain next to the ClientBuilder.
The current ClientBuilder implementation fails to compile unless a handler function and state are specified due to the generic values
S
andFut
of ClientBuilder being unable to resolve. This PR adds placeholder entries and a correspondingno_handler()
function for ClientBuilder that allows for a more straightforward implementation when using an exclusively ECS-based codebase.Note that
EmptyState
andEmptyFuture
must still be public for the code to compile, so I wrapped those in their own module. If needed, they can also be moved to a separate file, but I left them in thelib.rs
file so they would remain next to the ClientBuilder.