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

c-s: parser refactor #47

Merged
merged 4 commits into from
Aug 30, 2023

Commits on Aug 28, 2023

  1. c-s main: error print

    Changed error print to `:?` format, which displays the context stack.
    muzarski committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    3aea5a8 View commit details
    Browse the repository at this point in the history
  2. c-s command: adjust types

    Adjusted the types of `duration`, `consistency_level` and `serial_consistency_level` parameters.
    - `duration`: from `u64` to `std::time::Duration`.
    - `consistency_level`: from `ConsistencyLevel` to `scylla::statement::Consistency`.
    - `serial_consistency_level`: from `SerialConsistencyLevel` to `scylla::statement::SerialConsistency`.
    muzarski committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    3fbb32b View commit details
    Browse the repository at this point in the history
  3. c-s parser: introduce Parsable trait

    This commit introduces `Parsable` trait. It's implemented for the types
    that handle the string-to-Parsable::Parsed parsing logic.
    
    In this commit, we implement it for the most common types, as well as
    for some enum types such as `ConsistencyLevel`, etc.
    muzarski committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    f96f9df View commit details
    Browse the repository at this point in the history
  4. c-s parser: refactor

    Before this commit, the parser would only be responsible for input VALIDATION.
    The parameters' handles would return the strings that were matched to the
    given parameter (and validated). However, the ideal approach is so the
    user can retrieve the parsed value instead of validated String. This commit
    introduces the changes addressing this issue.
    
    The `SimpleParam` is now generic over `Parsable` trait, which is responsible
    for parsing strings to the specified type (`type Parsable::Parsed`).
    
    Adjusted the rest of the code to this change, including fixups in
    read/write command parsing.
    muzarski committed Aug 28, 2023
    Configuration menu
    Copy the full SHA
    cd409f9 View commit details
    Browse the repository at this point in the history