pub struct MdnsDiscovery { /* private fields */ }Expand description
mDNS discovery backend.
Sends and receives JSON-encoded MdnsAnnouncement packets over
UDP multicast. Filters out self-announcements and duplicates.
Implementations§
Source§impl MdnsDiscovery
impl MdnsDiscovery
Sourcepub fn new(
node_id: String,
listen_addr: String,
port: u16,
platform: String,
governance_genesis: String,
) -> Self
pub fn new( node_id: String, listen_addr: String, port: u16, platform: String, governance_genesis: String, ) -> Self
Create a new mDNS discovery backend.
Sourcepub fn local_announcement(&self) -> &MdnsAnnouncement
pub fn local_announcement(&self) -> &MdnsAnnouncement
Access the local announcement (for testing / introspection).
Trait Implementations§
Source§impl DiscoveryBackend for MdnsDiscovery
impl DiscoveryBackend for MdnsDiscovery
Source§fn start<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), DiscoveryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn start<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<(), DiscoveryError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Start the discovery mechanism.
Auto Trait Implementations§
impl !Freeze for MdnsDiscovery
impl RefUnwindSafe for MdnsDiscovery
impl Send for MdnsDiscovery
impl Sync for MdnsDiscovery
impl Unpin for MdnsDiscovery
impl UnsafeUnpin for MdnsDiscovery
impl UnwindSafe for MdnsDiscovery
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more