[PR #1576] [MERGED] Allow constructing responses for library users #2432

Closed
opened 2026-03-16 08:53:33 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hickory-dns/hickory-dns/pull/1576
Author: @pinkisemils
Created: 10/27/2021
Status: Merged
Merged: 11/4/2021
Merged by: @bluejekyll

Base: mainHead: allow-building-responses


📝 Commits (1)

  • 564b3c8 Allow constructing responses for lib users

📊 Changes

1 file changed (+14 additions, -2 deletions)

View changed files

📝 crates/server/src/authority/message_response.rs (+14 -2)

📄 Description

With the current code in main, it's not possible for library users to construct a MessageResponse, since creating a MessageResponseBuilder doesn't have any (public) methods that would construct it for legitimate reasons - the only new() method takes a private type as an argument. I've added a from_message_request method that is public and allows users of trust-dns-server to construct MessageResponse instances that correspond to specific requests.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hickory-dns/hickory-dns/pull/1576 **Author:** [@pinkisemils](https://github.com/pinkisemils) **Created:** 10/27/2021 **Status:** ✅ Merged **Merged:** 11/4/2021 **Merged by:** [@bluejekyll](https://github.com/bluejekyll) **Base:** `main` ← **Head:** `allow-building-responses` --- ### 📝 Commits (1) - [`564b3c8`](https://github.com/hickory-dns/hickory-dns/commit/564b3c89e12346ba41d11ece6d7b9506cf8f7ca1) Allow constructing responses for lib users ### 📊 Changes **1 file changed** (+14 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `crates/server/src/authority/message_response.rs` (+14 -2) </details> ### 📄 Description With the current code in `main`, it's not possible for library users to construct a `MessageResponse`, since creating a `MessageResponseBuilder` doesn't have any (public) methods that would construct it for legitimate reasons - the only [`new()`](https://github.com/bluejekyll/trust-dns/blob/63fdb8433346e8bb1c22a0f0aa0b3a1acf688ff6/crates/server/src/authority/message_response.rs#L129) method takes a private type as an argument. I've added a `from_message_request` method that _is_ public and allows users of `trust-dns-server` to construct `MessageResponse` instances that correspond to specific requests. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-16 08:53:33 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hickory-dns#2432
No description provided.