@@ -162,7 +162,7 @@ impl Mdns for BuiltinMdns {
162
162
where
163
163
U : UdpBind ,
164
164
{
165
- self . run ( matter, udp, mac, ipv4, ipv6, interface) . await
165
+ Self :: run ( self , matter, udp, mac, ipv4, ipv6, interface) . await
166
166
}
167
167
}
168
168
@@ -178,6 +178,12 @@ impl<'a> AvahiMdns<'a> {
178
178
pub const fn new ( connection : & ' a rs_matter:: utils:: zbus:: Connection ) -> Self {
179
179
Self { connection }
180
180
}
181
+
182
+ pub async fn run ( & mut self , matter : & Matter < ' _ > ) -> Result < ( ) , Error > {
183
+ rs_matter:: transport:: network:: mdns:: avahi:: AvahiMdnsResponder :: new ( matter)
184
+ . run ( self . connection )
185
+ . await
186
+ }
181
187
}
182
188
183
189
#[ cfg( feature = "zbus" ) ]
@@ -194,9 +200,7 @@ impl Mdns for AvahiMdns<'_> {
194
200
where
195
201
U : UdpBind ,
196
202
{
197
- rs_matter:: transport:: network:: mdns:: avahi:: AvahiMdnsResponder :: new ( matter)
198
- . run ( self . connection )
199
- . await
203
+ Self :: run ( self , matter) . await
200
204
}
201
205
}
202
206
@@ -212,6 +216,12 @@ impl<'a> ResolveMdns<'a> {
212
216
pub const fn new ( connection : & ' a rs_matter:: utils:: zbus:: Connection ) -> Self {
213
217
Self { connection }
214
218
}
219
+
220
+ pub async fn run ( & mut self , matter : & Matter < ' _ > ) -> Result < ( ) , Error > {
221
+ rs_matter:: transport:: network:: mdns:: resolve:: ResolveMdnsResponder :: new ( matter)
222
+ . run ( self . connection )
223
+ . await
224
+ }
215
225
}
216
226
217
227
#[ cfg( feature = "zbus" ) ]
@@ -228,16 +238,23 @@ impl Mdns for ResolveMdns<'_> {
228
238
where
229
239
U : UdpBind ,
230
240
{
231
- rs_matter:: transport:: network:: mdns:: resolve:: ResolveMdnsResponder :: new ( matter)
232
- . run ( self . connection )
233
- . await
241
+ Self :: run ( self , matter) . await
234
242
}
235
243
}
236
244
237
245
/// An mDNS responder for Matter using the `zeroconf` crate.
238
246
#[ cfg( feature = "zeroconf" ) ]
239
247
pub struct ZeroconfMdns ;
240
248
249
+ #[ cfg( feature = "zeroconf" ) ]
250
+ impl ZeroconfMdns {
251
+ pub async fn run ( & mut self , matter : & Matter < ' _ > ) -> Result < ( ) , Error > {
252
+ rs_matter:: transport:: network:: mdns:: zeroconf:: ZeroconfMdnsResponder :: new ( matter)
253
+ . run ( )
254
+ . await
255
+ }
256
+ }
257
+
241
258
#[ cfg( feature = "zeroconf" ) ]
242
259
impl Mdns for ZeroconfMdns {
243
260
async fn run < U > (
@@ -252,16 +269,23 @@ impl Mdns for ZeroconfMdns {
252
269
where
253
270
U : UdpBind ,
254
271
{
255
- rs_matter:: transport:: network:: mdns:: zeroconf:: ZeroconfMdnsResponder :: new ( matter)
256
- . run ( )
257
- . await
272
+ Self :: run ( self , matter) . await
258
273
}
259
274
}
260
275
261
276
/// An mDNS responder for Matter using the `astro-dnssd` crate.
262
277
#[ cfg( feature = "astro-dnssd" ) ]
263
278
pub struct AstroMdns ;
264
279
280
+ #[ cfg( feature = "astro-dnssd" ) ]
281
+ impl AstroMdns {
282
+ pub async fn run ( & mut self , matter : & Matter < ' _ > ) -> Result < ( ) , Error > {
283
+ rs_matter:: transport:: network:: mdns:: astro:: AstroMdnsResponder :: new ( matter)
284
+ . run ( )
285
+ . await
286
+ }
287
+ }
288
+
265
289
#[ cfg( feature = "astro-dnssd" ) ]
266
290
impl Mdns for AstroMdns {
267
291
async fn run < U > (
@@ -276,9 +300,7 @@ impl Mdns for AstroMdns {
276
300
where
277
301
U : UdpBind ,
278
302
{
279
- rs_matter:: transport:: network:: mdns:: astro:: AstroMdnsResponder :: new ( matter)
280
- . run ( )
281
- . await
303
+ Self :: run ( self , matter) . await
282
304
}
283
305
}
284
306
0 commit comments