pub struct ServerOptions {
pub host: String,
pub port: u16,
pub printers: PrinterRegistry,
pub device_backend: Arc<dyn DeviceBackend>,
pub print_job: PrintJobFn,
pub media_change: Option<MediaChangeFn>,
pub state_path: PathBuf,
pub advertise_mdns: bool,
}Expand description
Server configuration. Construct in your main, hand to Server::run.
Fields§
§host: String§port: u16§printers: PrinterRegistry§device_backend: Arc<dyn DeviceBackend>§print_job: PrintJobFn§media_change: Option<MediaChangeFn>Optional hook invoked when an operator sets the loaded media from the
web UI. None accepts every change without consulting the device.
state_path: PathBuf§advertise_mdns: boolWhen true (and the mdns feature is on), Server::run starts the
DNS-SD advertiser itself, immediately, from the registry as it stands
at bind time. Set false if the caller needs to advertise later —
e.g. after assigning each crate::printer::PrinterRecord::uuid from
an external source (a CUPS queue’s printer-uuid) so the advertised
UUID= matches a local queue and cups-browsed dedupes it. The caller
is then responsible for calling crate::mdns::Advertiser::register_all
and holding the handle.
Auto Trait Implementations§
impl !RefUnwindSafe for ServerOptions
impl !UnwindSafe for ServerOptions
impl Freeze for ServerOptions
impl Send for ServerOptions
impl Sync for ServerOptions
impl Unpin for ServerOptions
impl UnsafeUnpin for ServerOptions
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