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

Feature: Add TypeConfigExt to simplify RaftTypeConfig Access #1145

Merged
merged 1 commit into from
Jul 4, 2024

Commits on Jul 4, 2024

  1. Feature: Add TypeConfigExt to simplify RaftTypeConfig Access

    This commit introduces a new trait, `TypeConfigExt`, which extends
    `RaftTypeConfig`. The purpose of this trait is to simplify the access to
    various functionalities provided by the `RaftTypeConfig` trait,
    enhancing code readability and reducing complexity.
    
    **Methods Added to `TypeConfigExt`:**
    - `now()`
    - `sleep()`
    - `sleep_until()`
    - `timeout()`
    - `timeout_at()`
    - `oneshot()`
    - `spawn()`
    
    **Usage Improvement:**
    - Instead of using the
      `<<C as RaftTypeConfig>::AsyncRuntime as AsyncRuntime>::Instant::now()`,
      you can now simply call `C::now()`.
    drmingdrmer committed Jul 4, 2024
    Configuration menu
    Copy the full SHA
    272551d View commit details
    Browse the repository at this point in the history