zeroconf.rs 792 B

123456789101112131415161718192021222324252627282930
  1. #[cfg(feature = "dns-sd")]
  2. pub use dns_sd::*;
  3. #[cfg(not(feature = "dns-sd"))]
  4. pub use self::stub::*;
  5. #[cfg(not(feature = "dns-sd"))]
  6. pub mod stub {
  7. use std;
  8. use std::io::Write;
  9. #[derive(Debug)]
  10. pub struct DNSService;
  11. pub type DNSError = ();
  12. impl DNSService {
  13. pub fn register(_: Option<&str>,
  14. _: &str,
  15. _: Option<&str>,
  16. _: Option<&str>,
  17. _: u16,
  18. _: &[&str])
  19. -> std::result::Result<DNSService, DNSError> {
  20. writeln!(&mut std::io::stderr(),
  21. "WARNING: dns-sd is not enabled. Service will probably not be visible")
  22. .unwrap();
  23. Ok(DNSService)
  24. }
  25. }
  26. }