This simplifies some of the `Config` structure, in particular this
means:
Parameters which are meaningfully equivalent longer stored in
an `Option<T>`, an example of this is `channels`. If you don't
want to join any channels you simply leave it as empty instead.
In effect, `None` is behaviorally equivalent to `vec![]`.
We don't allocate when accessing certain configuration options.
For example, when accessing `channels` we used to allocate a
vector to handle the "empty case", we simply return the slice
corresponding to the list of channels instead.
We skip serializing empty or optional configuration fields.
From a deserialization perspective this is already something
that was mostly supported through use of `Option<T>` and
`#[serde(default)]`.
The Future is Send anyway, but this bound on the Box is neccessary
to use the future across threads because the compiler can't figure
out the Send bound otherwise.
This commit refactors IrcClientFuture and ConnectionFuture to own
the config instead of holding a reference.
This is required for reconnecting in dynamic contexts.
This is not possible with the old API, because Config is a reference,
requiring the value to live for the whole execution of the reactor.
This makes the return type of FormattedStringExt::strip_formatting
more meaningful.
Drawbacks:
In theory, it breaks backward compatbility due to the shape of
FormattedStringExt trait was changed. But I expected it's not the
problem for the most case because it's rare to implement that trait
while using this library.
Changed all involved structs to take `Config`s, rather than borrow them - this is due to `'static` requirement that is bound to crop up somewhere, when spawning a future into a reactor/runtime.
Updated examples and docs to reflect the change.
Migrated `conn` and `client` modules to `tokio` types;
Removed `handle` arguments and fields in `reactor`, `conn` and `client` modules;
Removed unused imports of `Handle`, updated doctest.