Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AsyncSource with tests, docs and examples #207

Merged
merged 12 commits into from Jul 10, 2021

Commits on Jun 26, 2021

  1. Refactor: Extract setting of cache to helper fn

    Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
    matthiasbeyer committed Jun 26, 2021
    Copy the full SHA
    49f935a View commit details
    Browse the repository at this point in the history
  2. Refactor: Import Result and use it instead of specifying full type path

    Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
    matthiasbeyer committed Jun 26, 2021
    Copy the full SHA
    ddc41bf View commit details
    Browse the repository at this point in the history
  3. Add doc to fn

    Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
    matthiasbeyer committed Jun 26, 2021
    Copy the full SHA
    bbb61a6 View commit details
    Browse the repository at this point in the history
  4. Add AsyncSource trait

    This patch adds the AsyncSource trait, the interface for providing async
    source functionality for this crate.
    
    Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
    Reviewed-by: Matthias Beyer <mail@beyermatthias.de>
    szarykott authored and matthiasbeyer committed Jun 26, 2021
    Copy the full SHA
    48e4a66 View commit details
    Browse the repository at this point in the history
  5. Reimplement the Config building mechanism

    This patch rewrites the Config building mechanism using special objects
    for tracking the config building state.
    
    Transitions between states are done on the fly as required.
    
    This is required so that the async sources can be stored inside the
    configuration building objects, while keeping out the expenses in the
    non-async case, so a user of the crate has only to pay for what they are
    using (no async means no overhead for that).
    
    Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
    Reviewed-by: Matthias Beyer <mail@beyermatthias.de>
    szarykott authored and matthiasbeyer committed Jun 26, 2021
    Copy the full SHA
    c708d44 View commit details
    Browse the repository at this point in the history

Commits on Jul 3, 2021

  1. Add example implementation using async source

    Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
    Reviewed-by: Matthias Beyer <mail@beyermatthias.de>
    szarykott committed Jul 3, 2021
    Copy the full SHA
    f4de34e View commit details
    Browse the repository at this point in the history
  2. Add test for async builder

    Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
    Reviewed-by: Matthias Beyer <mail@beyermatthias.de>
    szarykott committed Jul 3, 2021
    Copy the full SHA
    f8cef64 View commit details
    Browse the repository at this point in the history
  3. On 1.44.0, only test tests

    This is required because the examples pull in the "reqwest" crate, which
    depends on "socket2" and this crate fails to build if the "const fn"
    feature is not present (which wasn't on 1.44.0).
    
    Hence, we only run the tests in the 1.44.0 job, but do not compile the
    examples.
    
    Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
    matthiasbeyer authored and szarykott committed Jul 3, 2021
    Copy the full SHA
    f0f212e View commit details
    Browse the repository at this point in the history
  4. Bump MSRV to 1.46.0

    Because one of our dependencies (namingly `socket2`) uses match in a
    const fn, which is stabilized in rust 1.46.0, we bump to this version as
    MSRV for this crate.
    
    Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
    Tested-by: Matthias Beyer <mail@beyermatthias.de>
    matthiasbeyer authored and szarykott committed Jul 3, 2021
    Copy the full SHA
    1a7ca3c View commit details
    Browse the repository at this point in the history
  5. Fix clippy: Use &str instead of &String as argument

    Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
    matthiasbeyer authored and szarykott committed Jul 3, 2021
    Copy the full SHA
    55ba43d View commit details
    Browse the repository at this point in the history
  6. Fix clippy: Use to_string() instead of clone()

    Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
    matthiasbeyer authored and szarykott committed Jul 3, 2021
    Copy the full SHA
    18f01fd View commit details
    Browse the repository at this point in the history
  7. Simplify example impl

    With this simplification, we save a bit of code on one side, but also
    showcase that errors from custom AsyncSource implementations are
    possible because the ConfigError type provides a variant for it.
    
    Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
    Tested-by: Matthias Beyer <mail@beyermatthias.de>
    matthiasbeyer authored and szarykott committed Jul 3, 2021
    Copy the full SHA
    33c6432 View commit details
    Browse the repository at this point in the history