/// Equivalent to a call to `ffx target add`. This adds a target at `127.0.0.1:ssh_port`.
/// At this time, this is restricted to IPV4 only, as QEMU's DHCP server gets in the way of port
/// mapping on IPV6.
Equivalent to a call to `ffx target add`.
Equivalent to a call to ` ffx target add ` .
pub async fn add_target(proxy: &bridge::TargetCollectionProxy, ssh_port: u16) -> Result<()> {
    let mut addr = bridge::TargetAddrInfo::IpPort(bridge::TargetIpPort {
        ip: net::IpAddress::Ipv4(net::Ipv4Address {
            addr: "127.0.0.1".parse::<std::net::Ipv4Addr>().unwrap().octets().into(),
        }),
        port: ssh_port,
        scope_id: 0,
    });
    proxy.add_target(&mut addr).await?;
    log::debug!("[emulator] Added target {:?}", &addr);
    Ok(())
}
pub async fn add_target ( proxy : & bridge :: TargetCollectionProxy , ssh_port : u16 ) -> Result < ( ) > { let mut addr = bridge :: TargetAddrInfo :: IpPort ( bridge :: TargetIpPort { ip : net :: IpAddress :: Ipv4 ( net :: Ipv4Address { addr : " " . parse :: < std :: net :: Ipv4Addr > ( ) . unwrap ( ) . octets ( ) . into ( ) , } ) , port : ssh_port , scope_id : 0 , } ) ; proxy . add_target ( & mut addr ) . await ? ; log :: debug ! ( " " addr ) ; Ok ( ( ) ) }
Equivalent to a call to `ffx target add`.
Equivalent to a call to ` ffx target add ` .
proxy
&bridge::TargetCollectionProxy
ssh_port
u16