mod entry;
#[cfg(feature = "fake")]
mod fake;
mod inbox;
mod mdns;
mod options;
mod session;
mod txt;
mod worker;
#[cfg(feature = "zeroconf")]
mod zeroconf;
pub(crate) use entry::browse_projection;
pub use entry::{
BrowseMode, ChildService, Entry, EntryGroup, EntryGroupId, EntryId, GroupFacts, GroupingMode,
HostAggregate, HostKey, LogicalService, OccurrenceId, Registration, RowHost, RowServiceType,
ServiceTypeAggregate, TxtValue, UNRESOLVED_HOST_LABEL, browse_groups, browse_row_count,
decode_dns_sd_escapes,
};
pub use options::{
DEFAULT_DOMAIN, DiscoveryBackend, DiscoveryConfig, DiscoveryOptionError, DiscoveryOptions,
ServiceTypeFilter, TransportProtocol,
};
pub use session::{DiscoveryFailure, DiscoverySession, FailureKind, SessionPoll, SessionState};
pub(crate) const MAX_DISCOVERED_OCCURRENCES: usize = 4_096;
#[derive(Debug, Clone)]
pub enum DiscoveryEvent {
Upsert(Entry),
Remove(EntryId),
RemoveRegistration(Registration),
Status(String),
}
pub fn start(options: &DiscoveryOptions) -> DiscoverySession {
match options.backend() {
DiscoveryBackend::MdnsSd => mdns::start(options),
#[cfg(feature = "fake")]
DiscoveryBackend::Fake => fake::start(options),
#[cfg(feature = "zeroconf")]
DiscoveryBackend::Zeroconf => zeroconf::start(options),
}
}