-
-
Notifications
You must be signed in to change notification settings - Fork 1
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
Parse RPSL into borrowing ObjectView
convertible to owned Object
#50
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Return `rpsl::Attribute` directly from attribute parser, simplifying code and improving performance * Create enum `AttributeValue` for single and multiline RPSL values * Add `From<Vec<(&str, &str)>> for Object` * Add doctests for `From` implementaions * Replace for loop with an iterator * Ensure attributes with empty names cannot be constructed and remove imperfect conversions * Rename `AttributeValue` to `Value` * Make NonEmptyString public within crate * Simplify and organize RPSL module * Make `Object::new` public to crate * Cleanup parser module * Replace `tag("\n")` with `newline` * Fix visibility * Add `parse_whois_response` without implementation * Add `impl From<Vec<Attribute>> for Object` * Add `#[derive(Debug, PartialEq)]` to `Object` * Make attribute and object constructors public * Add constructor to create empty attributes * Refactor parser to add parse_whois_response * Adjust benchmark to API * Add benchmark for parsing of AS3257 whois response * Fix typo * derive `Eq` on all public structs * Implement `PartialEq<&str>` for `Name` * `impl fmt::Display for Name` * Add some examples * Update README * Add examples to `Object` * impl Index<usize> for Object * Move private doctests to unit tests * Implement `IntoIterator` and len for `Object` * Simplify `pub fn parse_whois_response` * Add some examples * Add continuation_char parser * Optimize attribute parser * Don't use `super` in subcomponent module * Use delimited instead of tuple in `continuation_line` parser * Flatten tests * Add tests for RPSL Object representation * Implement `Display` trait for `Object` * Add `InvalidNameError` error type * Disallow use of `panic!` using clippy * Fix some clippy lints * Add `AttributeError` error type * Remove unneeded `#[must_use]` * Add `Error` section to parser docs * Add `InvalidValueError` * Adjust doctests * Add object text representation * Add (doc)tests for desired object `get` behavior * Add empty `get` fn to `Object` * Add get implementation that passes tests * Expose `rpsl::attribute` module within crate instead of `rpsl::attribute::Value` * Derive `Clone` on `Object` and contained types * Replace `TryFrom<&str>` for `Name` with `FromStr` * Remove assets related to python bindings To be re-implemented in dedicated repository * Make `rpsl::error` public instead of exposing `rpsl::error::AttributeError` directly * Re add codespell configuration removed with pyproject.toml * Fix typos
CodSpeed Performance ReportMerging #50 will improve performances by ×2.3Comparing Summary
Benchmarks breakdown
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Parse RPSL into types that contain references to the original text instead of creating assignments for each attribute during parsing. This PR also contains an
object!
macro, making it easier to create anObject
, as well as complete input validation for creating owned types.