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(), + }), }) }