pub trait AdvertiserControl: Send + Sync {
// Required methods
fn publish(&self, rec: &PrinterRecord);
fn withdraw(&self, name: &str);
fn is_advertised(&self, name: &str) -> bool;
}Expand description
Lets the status poller pull a printer out of DNS-SD discovery when its
device goes offline, and republish it when the device returns — so a
powered-off printer stops showing up in print dialogs. Implemented by
crate::mdns::Advertiser; the poller holds it as a trait object so the
poller stays independent of the optional mdns feature.
Required Methods§
Sourcefn publish(&self, rec: &PrinterRecord)
fn publish(&self, rec: &PrinterRecord)
Republish the printer’s discovery advert (its device came back online). Idempotent: a no-op if already advertised.
Sourcefn withdraw(&self, name: &str)
fn withdraw(&self, name: &str)
Withdraw the printer’s discovery advert (its device went offline). Idempotent: a no-op if not currently advertised.
Sourcefn is_advertised(&self, name: &str) -> bool
fn is_advertised(&self, name: &str) -> bool
Whether this printer is currently advertised.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".