#![doc = include_str!("../README.md")]
#![cfg_attr(not(test), forbid(unsafe_code))]
#![cfg_attr(test, deny(unsafe_code))]
#![deny(missing_docs)]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![cfg_attr(docsrs, allow(unused_attributes))]
mod command;
mod discovery;
mod driver;
mod endpoint;
mod error;
mod options;
mod proto;
mod query;
mod service;
#[cfg(all(test, feature = "tracing", not(miri)))]
mod trace_cov;
pub use discovery::{Lookup, QueryParam, ServiceEntry};
pub use endpoint::Endpoint;
pub use error::{CancelError, RegisterError, ServerError, StartQueryError};
pub use options::ServerOptions;
pub use query::{Query, QueryEvent};
pub use service::Service;
pub use mdns_proto::{
CollectedAnswer, EndpointConfig, Name, QueryHandle, QuerySpec, ServiceHandle, ServiceRecords,
ServiceRenamed, ServiceSpec, ServiceUpdate, config, error as proto_error, event, wire,
};
#[cfg(feature = "tokio")]
#[cfg_attr(docsrs, doc(cfg(feature = "tokio")))]
pub mod tokio {
use crate::options::ServerOptions;
pub type Endpoint = crate::Endpoint;
#[inline]
pub async fn server(opts: ServerOptions) -> Result<Endpoint, crate::ServerError> {
Endpoint::server::<agnostic_net::tokio::Net>(opts).await
}
}
#[cfg(feature = "smol")]
#[cfg_attr(docsrs, doc(cfg(feature = "smol")))]
pub mod smol {
use crate::options::ServerOptions;
pub type Endpoint = crate::Endpoint;
#[inline]
pub async fn server(opts: ServerOptions) -> Result<Endpoint, crate::ServerError> {
Endpoint::server::<agnostic_net::smol::Net>(opts).await
}
}