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

Use Bytes to represent custom headers #949

Closed
caspervonb opened this issue May 1, 2023 · 0 comments · Fixed by #967
Closed

Use Bytes to represent custom headers #949

caspervonb opened this issue May 1, 2023 · 0 comments · Fixed by #967
Assignees
Labels
accepted The defect or proposal as been accepted enhancement Enhancement to existing functionality

Comments

@caspervonb
Copy link
Collaborator

caspervonb commented May 1, 2023

Use case

HeaderNames are well known within a program, if we use bytes to represent header names we can make use of from_static to allocate static header names.

Proposed change

Introduce from_static on HeaderName and make the internal representation for custom header names Bytes.

let header_name = HeaderName::from_static("X-Custom-Foo");

Internal representation would be

struct Custom {
  inner: Bytes
}

Who benefits from the change(s)?

Everyone

Alternative Approaches

No response

@caspervonb caspervonb added enhancement Enhancement to existing functionality needs triage and removed needs triage labels May 1, 2023
@caspervonb caspervonb self-assigned this May 1, 2023
@bruth bruth added accepted The defect or proposal as been accepted and removed ready labels Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted The defect or proposal as been accepted enhancement Enhancement to existing functionality
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants