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

Provide a signature! macro that constructs a const singature #984

Open
zeenix opened this issue Sep 11, 2024 · 0 comments
Open

Provide a signature! macro that constructs a const singature #984

zeenix opened this issue Sep 11, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers zvariant_derive Issues/PRs related to zvariant_derive crate zvariant Issues/PRs related to zvariant crate

Comments

@zeenix
Copy link
Contributor

zeenix commented Sep 11, 2024

This was discussed before but at the time, we didn't have the means to do it. Now it should quite easy, with the parsed signature type. In fact, the Type macro is already doing it for its signature attribute. This would be mostly about moving that logic out into a separate macro. The folks can do things like:

let singature = signature!("a{sv}");
const SIGNATURE: Signature = signature!("a{sv}");

with the string checked at compile-time.

@zeenix zeenix added enhancement New feature or request good first issue Good for newcomers zvariant Issues/PRs related to zvariant crate zvariant_derive Issues/PRs related to zvariant_derive crate labels Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers zvariant_derive Issues/PRs related to zvariant_derive crate zvariant Issues/PRs related to zvariant crate
Projects
None yet
Development

No branches or pull requests

1 participant