+6
-1
sachy-mdns/src/service.rs
+6
-1
sachy-mdns/src/service.rs
···
62
62
hostname: String,
63
63
ip: Option<IpAddr>,
64
64
port: u16,
65
+
txt: Vec<&'static str>,
65
66
}
66
67
67
68
impl Service {
···
71
72
hostname: impl Into<String>,
72
73
ip: Option<IpAddr>,
73
74
port: u16,
75
+
txt: impl Into<Vec<&'static str>>,
74
76
) -> Self {
75
77
let service_type = service_type.into();
76
78
let mut instance = instance.into();
···
86
88
hostname,
87
89
ip,
88
90
port,
91
+
txt: txt.into(),
89
92
}
90
93
}
91
94
···
142
145
atype: QType::TXT,
143
146
aclass,
144
147
ttl: 120,
145
-
record: Record::TXT(TXT { text: Vec::new() }),
148
+
record: Record::TXT(TXT {
149
+
text: self.txt.clone(),
150
+
}),
146
151
})
147
152
}
148
153
History
1 round
0 comments
sachy.dev
submitted
#0
1 commit
expand
collapse
Add txt records to mDNS service struct
2/2 success
expand
collapse
expand 0 comments
pull request successfully merged