From b76d1dc183591a9f6ebf161ed1d8fdeaae006610 Mon Sep 17 00:00:00 2001 From: Sachymetsu Date: Wed, 4 Mar 2026 16:28:12 +0100 Subject: [PATCH] Add txt records to mDNS service struct --- sachy-mdns/src/service.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sachy-mdns/src/service.rs b/sachy-mdns/src/service.rs index 014c4a6..0fae964 100644 --- a/sachy-mdns/src/service.rs +++ b/sachy-mdns/src/service.rs @@ -62,6 +62,7 @@ pub struct Service { hostname: String, ip: Option, port: u16, + txt: Vec<&'static str>, } impl Service { @@ -71,6 +72,7 @@ impl Service { hostname: impl Into, ip: Option, port: u16, + txt: impl Into>, ) -> Self { let service_type = service_type.into(); let mut instance = instance.into(); @@ -86,6 +88,7 @@ impl Service { hostname, ip, port, + txt: txt.into(), } } @@ -142,7 +145,9 @@ impl Service { atype: QType::TXT, aclass, ttl: 120, - record: Record::TXT(TXT { text: Vec::new() }), + record: Record::TXT(TXT { + text: self.txt.clone(), + }), }) } -- 2.51.2