pub struct ServiceBridge<H, SCOPE = H>where
H: StateHandler + 'static,
SCOPE: 'static,{ /* private fields */ }Expand description
A bridge to a StateService. This allows message passing with state handlers, as well as their parent service. Useful when you want to access the events emitted by StateService.
Implementations§
Source§impl<H, SCOPE> ServiceBridge<H, SCOPE>where
H: StateHandler + 'static,
impl<H, SCOPE> ServiceBridge<H, SCOPE>where
H: StateHandler + 'static,
Sourcepub fn new(callback: Callback<ServiceOutput<H>>) -> Self
pub fn new(callback: Callback<ServiceOutput<H>>) -> Self
Create a new bridge, automatically subscribing.
Sourcepub fn send_service(&mut self, msg: ServiceRequest<H>)
pub fn send_service(&mut self, msg: ServiceRequest<H>)
Send message to service.
Sourcepub fn send_handler(&mut self, msg: H::Input)
pub fn send_handler(&mut self, msg: H::Input)
Send message to handler.
Auto Trait Implementations§
impl<H, SCOPE> Freeze for ServiceBridge<H, SCOPE>
impl<H, SCOPE = H> !RefUnwindSafe for ServiceBridge<H, SCOPE>
impl<H, SCOPE = H> !Send for ServiceBridge<H, SCOPE>
impl<H, SCOPE = H> !Sync for ServiceBridge<H, SCOPE>
impl<H, SCOPE> Unpin for ServiceBridge<H, SCOPE>
impl<H, SCOPE = H> !UnwindSafe for ServiceBridge<H, SCOPE>
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