Struct ipc_channel::router::ROUTER
source · [−]pub struct ROUTER { /* private fields */ }
Expand description
Global object wrapping a RouterProxy
.
Add routes (add_route), or convert IpcReceiver
Methods from Deref<Target = RouterProxy>
sourcepub fn add_route(&self, receiver: OpaqueIpcReceiver, callback: RouterHandler)
pub fn add_route(&self, receiver: OpaqueIpcReceiver, callback: RouterHandler)
Add a new (receiver, callback) pair to the router, and send a wakeup message to the router.
sourcepub fn shutdown(&self)
pub fn shutdown(&self)
Send a shutdown message to the router containing a ACK sender, send a wakeup message to the router, and block on the ACK. Calling it is idempotent, which can be useful when running a multi-process system in single-process mode.
sourcepub fn route_ipc_receiver_to_crossbeam_sender<T>(
&self,
ipc_receiver: IpcReceiver<T>,
crossbeam_sender: Sender<T>
) where
T: for<'de> Deserialize<'de> + Serialize + Send + 'static,
pub fn route_ipc_receiver_to_crossbeam_sender<T>(
&self,
ipc_receiver: IpcReceiver<T>,
crossbeam_sender: Sender<T>
) where
T: for<'de> Deserialize<'de> + Serialize + Send + 'static,
A convenience function to route an IpcReceiver<T>
to an existing Sender<T>
.
sourcepub fn route_ipc_receiver_to_new_crossbeam_receiver<T>(
&self,
ipc_receiver: IpcReceiver<T>
) -> Receiver<T> where
T: for<'de> Deserialize<'de> + Serialize + Send + 'static,
pub fn route_ipc_receiver_to_new_crossbeam_receiver<T>(
&self,
ipc_receiver: IpcReceiver<T>
) -> Receiver<T> where
T: for<'de> Deserialize<'de> + Serialize + Send + 'static,
A convenience function to route an IpcReceiver<T>
to a Receiver<T>
: the most common
use of a Router
.
Trait Implementations
sourceimpl Deref for ROUTER
impl Deref for ROUTER
type Target = RouterProxy
type Target = RouterProxy
The resulting type after dereferencing.
sourcefn deref(&self) -> &RouterProxy
fn deref(&self) -> &RouterProxy
Dereferences the value.
impl LazyStatic for ROUTER
Auto Trait Implementations
impl RefUnwindSafe for ROUTER
impl Send for ROUTER
impl Sync for ROUTER
impl Unpin for ROUTER
impl UnwindSafe for ROUTER
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more