pub struct Server;Expand description
Entry point — Server::run(opts).await starts the listener.
Implementations§
Source§impl Server
impl Server
Sourcepub fn router(opts: ServerOptions) -> Router
pub fn router(opts: ServerOptions) -> Router
Build the axum router with the configured state attached. Returned
router can be served via Server::run or by hand.
Sourcepub async fn run(opts: ServerOptions) -> Result<()>
pub async fn run(opts: ServerOptions) -> Result<()>
Bind to host:port, spawn the background status poller (and the mDNS
advertiser if the mdns feature is enabled), and run the axum
listener until it errors.
Sourcepub fn bootstrap_printers(
registry: &PrinterRegistry,
backend: &dyn DeviceBackend,
state_path: &Path,
make_config: impl Fn(&str, &str, &str, &str) -> Option<PrinterConfig>,
)
pub fn bootstrap_printers( registry: &PrinterRegistry, backend: &dyn DeviceBackend, state_path: &Path, make_config: impl Fn(&str, &str, &str, &str) -> Option<PrinterConfig>, )
Load printers from disk, discover devices, merge into registry.
Sourcepub fn persist(registry: &PrinterRegistry, state_path: &Path)
pub fn persist(registry: &PrinterRegistry, state_path: &Path)
Snapshot the registry to state_path as JSON. Called automatically
at the end of every print job; expose for callers that want to
persist after manual registry edits.
Auto Trait Implementations§
impl Freeze for Server
impl RefUnwindSafe for Server
impl Send for Server
impl Sync for Server
impl Unpin for Server
impl UnsafeUnpin for Server
impl UnwindSafe for Server
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