+6
-1
sachy-mdns/src/service.rs
+6
-1
sachy-mdns/src/service.rs
···
62
hostname: String,
63
ip: Option<IpAddr>,
64
port: u16,
65
}
66
67
impl Service {
···
71
hostname: impl Into<String>,
72
ip: Option<IpAddr>,
73
port: u16,
74
) -> Self {
75
let service_type = service_type.into();
76
let mut instance = instance.into();
···
86
hostname,
87
ip,
88
port,
89
}
90
}
91
···
142
atype: QType::TXT,
143
aclass,
144
ttl: 120,
145
-
record: Record::TXT(TXT { text: Vec::new() }),
146
})
147
}
148
···
62
hostname: String,
63
ip: Option<IpAddr>,
64
port: u16,
65
+
txt: Vec<&'static str>,
66
}
67
68
impl Service {
···
72
hostname: impl Into<String>,
73
ip: Option<IpAddr>,
74
port: u16,
75
+
txt: impl Into<Vec<&'static str>>,
76
) -> Self {
77
let service_type = service_type.into();
78
let mut instance = instance.into();
···
88
hostname,
89
ip,
90
port,
91
+
txt: txt.into(),
92
}
93
}
94
···
145
atype: QType::TXT,
146
aclass,
147
ttl: 120,
148
+
record: Record::TXT(TXT {
149
+
text: self.txt.clone(),
150
+
}),
151
})
152
}
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