pub struct RpcFactory {
pub owner_into_cell: Arc<dyn Fn(Arc<dyn Any + Send + Sync>) -> Arc<HostedRpcOwnerCell> + Send + Sync + 'static>,
pub build_stub: Arc<dyn Fn(HostedRpcChannel) -> Arc<dyn Any + Send + Sync> + Send + Sync + 'static>,
}Expand description
Factory pair stored on a HostedRpc RegisteredDependency. The macro
emits a RpcFactory per registered HostedRpc dep so the runtime can
(a) wrap the constructor’s output into a parent dispatcher cell, and
(b) build a worker-side stub from a channel.
Fields§
§owner_into_cell: Arc<dyn Fn(Arc<dyn Any + Send + Sync>) -> Arc<HostedRpcOwnerCell> + Send + Sync + 'static>Downcast the constructor’s Arc<dyn Any> to the concrete
HostedRpcOwnerCell for this dep.
build_stub: Arc<dyn Fn(HostedRpcChannel) -> Arc<dyn Any + Send + Sync> + Send + Sync + 'static>Build a worker-side stub (typed as the dep’s Stub associated type)
from the supplied channel, boxed as Arc<dyn Any>.
Trait Implementations§
Source§impl Clone for RpcFactory
impl Clone for RpcFactory
Source§fn clone(&self) -> RpcFactory
fn clone(&self) -> RpcFactory
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 RpcFactory
impl !RefUnwindSafe for RpcFactory
impl Send for RpcFactory
impl Sync for RpcFactory
impl Unpin for RpcFactory
impl UnsafeUnpin for RpcFactory
impl !UnwindSafe for RpcFactory
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