BrowsingContext allows for the user to declare a single, or multiple, type(s) of services they are interested in and poll the instance to get discovered Services.
Usage of this might look something like:
let ctx: BrowsingContext = BrowsingContext::new().query("_http._tcp.local").query("_http-alt._tcp.local").search();
let mut services = vec![];
loop {
if let Some(service) = ctx.poll() {
services.push(service);
}
// ...
}
I take inspiration to other APIs that do similar things, such as sockets, IO, etc., and have a sort of queue-based polling system which I think works well for now. If not, I can change it at a later date, but it will suffice for an initial implementation.
Actually, on second thought, polling would be unfit for the sorts of applications I want to use this for, those being non-immediate mode UI. Rather an Arc<Mutex<Vec<Service>>> might be better.
BrowsingContext
allows for the user to declare a single, or multiple, type(s) of services they are interested in and poll the instance to get discoveredService
s.Usage of this might look something like:
I take inspiration to other APIs that do similar things, such as sockets, IO, etc., and have a sort of queue-based polling system which I think works well for now. If not, I can change it at a later date, but it will suffice for an initial implementation.