Skip to content

dynamic_modules: refactor RUST SDK to add repr(transparent)#43798

Merged
agrawroh merged 1 commit intoenvoyproxy:mainfrom
agrawroh:feat-dm-refac
Mar 5, 2026
Merged

dynamic_modules: refactor RUST SDK to add repr(transparent)#43798
agrawroh merged 1 commit intoenvoyproxy:mainfrom
agrawroh:feat-dm-refac

Conversation

@agrawroh
Copy link
Copy Markdown
Member

@agrawroh agrawroh commented Mar 5, 2026

Description

We are missing #[repr(transparent)] on the metrics methods. This PR is to add it.


Commit Message: dynamic_modules: refactor RUST SDK to add repr(transparent)
Additional Description: Added missing #[repr(transparent)] on the metrics methods.
Risk Level: Low
Testing: CI
Docs Changes: N/A
Release Notes: N/A

@repokitteh-read-only
Copy link
Copy Markdown

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #43798 was opened by agrawroh.

see: more, trace.

@agrawroh agrawroh marked this pull request as ready for review March 5, 2026 19:17
Copy link
Copy Markdown
Member

@mathetake mathetake left a comment

Choose a reason for hiding this comment

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

why not repr(C)?

@agrawroh
Copy link
Copy Markdown
Member Author

agrawroh commented Mar 5, 2026

why not repr(C)?

My understanding, looking at the docs is this:
repr(transparent) is specifically designed for single-field newtypes. It guarantees identical layout and ABI to the inner type, which is what makes the transmute::<usize, EnvoyCounterId> sound. Whereas repr(C) gives a defined layout but doesn't guarantee ABI equivalence for single-field structs.

@agrawroh agrawroh merged commit 51c1fb2 into envoyproxy:main Mar 5, 2026
29 checks passed
bmjask pushed a commit to bmjask/envoy that referenced this pull request Mar 14, 2026
…xy#43798)

## Description

We are missing `#[repr(transparent)]` on the metrics methods. This PR is
to add it.

---

**Commit Message:** dynamic_modules: refactor RUST SDK to add
repr(transparent)
**Additional Description:** Added missing `#[repr(transparent)]` on the
metrics methods.
**Risk Level:** Low
**Testing:** CI
**Docs Changes:** N/A
**Release Notes:** N/A

Signed-off-by: Rohit Agrawal <[email protected]>
Signed-off-by: bjmask <[email protected]>
bvandewalle pushed a commit to bvandewalle/envoy that referenced this pull request Mar 17, 2026
…xy#43798)

## Description

We are missing `#[repr(transparent)]` on the metrics methods. This PR is
to add it.

---

**Commit Message:** dynamic_modules: refactor RUST SDK to add
repr(transparent)
**Additional Description:** Added missing `#[repr(transparent)]` on the
metrics methods.
**Risk Level:** Low
**Testing:** CI
**Docs Changes:** N/A
**Release Notes:** N/A

Signed-off-by: Rohit Agrawal <[email protected]>
fishcakez pushed a commit to fishcakez/envoy that referenced this pull request Mar 25, 2026
…xy#43798)

## Description

We are missing `#[repr(transparent)]` on the metrics methods. This PR is
to add it.

---

**Commit Message:** dynamic_modules: refactor RUST SDK to add
repr(transparent)
**Additional Description:** Added missing `#[repr(transparent)]` on the
metrics methods.
**Risk Level:** Low
**Testing:** CI
**Docs Changes:** N/A
**Release Notes:** N/A

Signed-off-by: Rohit Agrawal <[email protected]>
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