-
Notifications
You must be signed in to change notification settings - Fork 287
Add a readme for the macros crate #2491
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
Open
RickWinter
wants to merge
5
commits into
Azure:main
Choose a base branch
from
RickWinter:readme
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
faeced0
Add a readme for the macros crate
RickWinter 438ddbb
Update sdk/typespec/typespec_macros/README.md
RickWinter c2ae249
Cleanup the readme from feedback
RickWinter 6215fce
Merge branch 'readme' of https://github.com/RickWinter/azure-sdk-for-…
RickWinter 574d7e4
Remove empty section
RickWinter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# TypeSpec Macros crate for Rust | ||
|
||
The TypeSpec Macros crate provides procedural macros for [TypeSpec](https://typespec.io)-generated client libraries. These macros simplify the implementation of common patterns required when working with TypeSpec-generated code. | ||
|
||
[Source code] | [Package (crates.io)] | [API reference documentation] | [TypeSpec documentation] | ||
|
||
## Getting started | ||
|
||
> **Note:** This crate is primarily intended for internal use by the `typespec_client_core` crate. Direct usage is discouraged unless you are contributing to or debugging the TypeSpec ecosystem. | ||
|
||
## Key concepts | ||
|
||
This crate provides the following derive macros: | ||
|
||
- `Model`: A derive macro that implements the `Model` trait, allowing a type to be deserialized from an HTTP response body. | ||
- `SafeDebug`: A derive macro that implements debug formatting in a way that avoids leaking personally identifiable information (PII). | ||
|
||
### The Model derive macro | ||
|
||
The `Model` derive macro is used to implement the `Model` trait for structs that represent data returned from an API. It handles the deserialization of HTTP response bodies into your model types. | ||
|
||
### The SafeDebug derive macro | ||
|
||
The `SafeDebug` derive macro creates a `Debug` implementation that respects the `#[sensitive]` attribute on struct fields. Fields marked with this attribute will not have their values printed in debug output, protecting potentially sensitive information. | ||
RickWinter marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
## Contributing | ||
|
||
See the [CONTRIBUTING.md] for details on building, testing, and contributing to this library. | ||
RickWinter marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit <https://opensource.microsoft.com/cla/>. | ||
|
||
When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA. | ||
|
||
This project has adopted the [Microsoft Open Source Code of Conduct]. For more information see the [Code of Conduct FAQ] or contact <[email protected]> with any additional questions or comments. | ||
|
||
[Source code]: https://github.com/Azure/azure-sdk-for-rust/tree/main/sdk/typespec/typespec_macros/src | ||
[Package (crates.io)]: https://crates.io/crates/typespec_macros | ||
[API reference documentation]: https://docs.rs/typespec_macros | ||
[TypeSpec documentation]: https://typespec.io/ | ||
[CONTRIBUTING.md]: https://github.com/Azure/azure-sdk-for-rust/blob/main/CONTRIBUTING.md | ||
[Microsoft Open Source Code of Conduct]: https://opensource.microsoft.com/codeofconduct/ | ||
[Code of Conduct FAQ]: https://opensource.microsoft.com/codeofconduct/faq/ |
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.