pub struct EventHubClient { /* private fields */ }Expand description
EventHubClient - handles event passing from backend to UI Subscribe callbacks to specific event origins and start the event loop.
Implementations§
Source§impl EventHubClient
impl EventHubClient
Sourcepub fn subscribe<F>(&self, origin: Origin, callback: F) -> SubscriptionToken
pub fn subscribe<F>(&self, origin: Origin, callback: F) -> SubscriptionToken
Subscribe a callback to an origin. The returned SubscriptionToken
removes the callback from the subscribers map when dropped — hold it
for as long as you want the callback to fire, then drop it to
unsubscribe.
Sourcepub fn start(&self, quit_signal: Arc<AtomicBool>)
pub fn start(&self, quit_signal: Arc<AtomicBool>)
Start the event loop in a background thread Blocks on the flume receiver — no polling, zero CPU when idle
Trait Implementations§
Source§impl Clone for EventHubClient
impl Clone for EventHubClient
Source§fn clone(&self) -> EventHubClient
fn clone(&self) -> EventHubClient
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for EventHubClient
impl RefUnwindSafe for EventHubClient
impl Send for EventHubClient
impl Sync for EventHubClient
impl Unpin for EventHubClient
impl UnsafeUnpin for EventHubClient
impl UnwindSafe for EventHubClient
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