adb_utils/commands/networking/
mdns.rs

1use std::process::Command;
2
3use crate::{ADBCommand, ADBResult};
4
5/// https://en.wikipedia.org/wiki/Multicast_DNS
6pub struct ADBMdns {
7    shell: Command,
8}
9
10impl ADBMdns {
11    /// Check if mdns discovery is available
12    pub fn check() -> Self {
13        let mut cmd = Command::new("adb");
14        cmd.arg("check");
15
16        ADBMdns { shell: cmd }
17    }
18
19    /// List all discovered services
20    pub fn services() -> Self {
21        let mut cmd = Command::new("adb");
22        cmd.arg("services");
23
24        ADBMdns { shell: cmd }
25    }
26}
27
28impl ADBCommand for ADBMdns {
29    fn build(&mut self) -> Result<&mut Command, String> {
30        Ok(&mut self.shell)
31    }
32
33    fn process_output(&self, output: ADBResult) -> ADBResult {
34        output
35    }
36}