pub struct MdnsClient { /* private fields */ }Expand description
ctx.mdns — find and offer services on the local network.
The plugin’s sandbox cannot bind the mDNS port, so the host runs the
responder: advertise publishes one of the plugin’s declared listen ports
under the node’s hostname for as long as this connection lives, and
browse collects the instances of one service type.
Implementations§
Source§impl MdnsClient
impl MdnsClient
Sourcepub async fn advertise(
&self,
service_type: &str,
port: u16,
txt: &BTreeMap<String, String>,
) -> Result<Advertised, ClientError>
pub async fn advertise( &self, service_type: &str, port: u16, txt: &BTreeMap<String, String>, ) -> Result<Advertised, ClientError>
Publish port as service_type with txt. Needs network.listen,
and the port must be a declared listen port of a service that runs on
this node. See PluginIpcClient::mdns_advertise.
Sourcepub async fn browse(
&self,
service_type: &str,
window: Duration,
) -> Result<Vec<DiscoveredService>, ClientError>
pub async fn browse( &self, service_type: &str, window: Duration, ) -> Result<Vec<DiscoveredService>, ClientError>
Every instance of service_type answering within window. Needs
network.outbound. See PluginIpcClient::mdns_browse.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for MdnsClient
impl !UnwindSafe for MdnsClient
impl Freeze for MdnsClient
impl Send for MdnsClient
impl Sync for MdnsClient
impl Unpin for MdnsClient
impl UnsafeUnpin for MdnsClient
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more