pub struct LiveSource { /* private fields */ }Expand description
A PrinterSource backed by a live LAN MQTT connection.
A dedicated OS thread runs the blocking LanMqttClient::monitor loop (which
owns its own current-thread runtime and auto-reconnects internally), turning
each merged report into a PrinterStatus pushed onto a watch channel.
The thread reconnects forever until the source and all its subscribers drop.
Implementations§
Source§impl LiveSource
impl LiveSource
Sourcepub fn connect(target: ResolvedTarget, interval: Option<Duration>) -> Self
pub fn connect(target: ResolvedTarget, interval: Option<Duration>) -> Self
Connect to target and start streaming live status. interval is the
pushall poll period; None relies on the printer’s autonomous ~2 s push
(the gentlest option, the default for an always-on dashboard).
Trait Implementations§
Source§impl PrinterSource for LiveSource
impl PrinterSource for LiveSource
Source§fn current(&self) -> PrinterStatus
fn current(&self) -> PrinterStatus
The latest known status.
Source§fn subscribe(&self) -> Receiver<PrinterStatus>
fn subscribe(&self) -> Receiver<PrinterStatus>
Subscribe to status updates. The receiver’s current value is whatever
the source last held; callers should send it first (via
borrow_and_update)
and then await changed() for each subsequent update.Auto Trait Implementations§
impl Freeze for LiveSource
impl RefUnwindSafe for LiveSource
impl Send for LiveSource
impl Sync for LiveSource
impl Unpin for LiveSource
impl UnsafeUnpin for LiveSource
impl UnwindSafe for LiveSource
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