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

[PLATFORM-865]: Add a builder type for redaction to Veil, for manually redacting arbitrary data #64

Conversation

WilliamVenner
Copy link
Contributor

https://prima-assicurazioni-spa.myjetbrains.com/youtrack/issue/PLATFORM-865

This PR introduces the Redactor, RedactorBuilder and RedactWrapped types.

The RedactorBuilder allows for building a Redactor using familiar flags seen in the #[redact] derive macro. The built Redactor may then be used to redact any arbitrary data using the flags provided.

The RedactorBuilder has been set up for 100% const evaluation, therefore the compiler is able to completely eliminate any error checking at compile time. The error checking is zero cost if everything is known at compile time :D

Finally I have also used the RedactWrapped type as a convenience API. It is returned by the wrap method of Redactor. I have documented this with examples, and plan to document everything on a higher level (e.g. in examples/ and the crate root docs) in a separate PR.

@WilliamVenner WilliamVenner requested a review from a team as a code owner December 15, 2022 14:28
@WilliamVenner WilliamVenner force-pushed the PLATFORM-865/user-story/add-a-builder-type-for-redaction-to-veil-for-manually-redacting-arbitrary-data branch from b4108e6 to fffffb7 Compare December 15, 2022 14:32
src/builder.rs Outdated Show resolved Hide resolved
src/builder.rs Outdated Show resolved Hide resolved
src/builder.rs Outdated Show resolved Hide resolved
src/builder.rs Outdated Show resolved Hide resolved
src/builder.rs Outdated Show resolved Hide resolved
src/lib.rs Outdated Show resolved Hide resolved
@WilliamVenner WilliamVenner force-pushed the PLATFORM-865/user-story/add-a-builder-type-for-redaction-to-veil-for-manually-redacting-arbitrary-data branch from fffffb7 to 3321d93 Compare December 20, 2022 11:22
src/redactor.rs Outdated Show resolved Hide resolved
MaeIsBad
MaeIsBad previously approved these changes Dec 20, 2022
Copy link
Member

@MaeIsBad MaeIsBad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good to merge, but I'd wait for another review on all these PRs

@WilliamVenner WilliamVenner force-pushed the PLATFORM-865/user-story/add-a-builder-type-for-redaction-to-veil-for-manually-redacting-arbitrary-data branch from 9dc2a91 to 76abc3b Compare December 20, 2022 15:35
@WilliamVenner WilliamVenner merged commit ff14749 into master Dec 22, 2022
@WilliamVenner WilliamVenner deleted the PLATFORM-865/user-story/add-a-builder-type-for-redaction-to-veil-for-manually-redacting-arbitrary-data branch December 22, 2022 10:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants