pub struct RemotePropsRegistry { /* private fields */ }Expand description
Per-system registry of (manifest, factory) pairs.
Implementations§
Source§impl RemotePropsRegistry
impl RemotePropsRegistry
pub fn new() -> Self
Sourcepub fn register<F>(&self, manifest: impl Into<String>, factory: F)
pub fn register<F>(&self, manifest: impl Into<String>, factory: F)
Register a factory for manifest. The factory receives the
serialized payload and returns a reconstructed type-erased
value the receiver can downcast.
Sourcepub fn instantiate(
&self,
manifest: &str,
bytes: &[u8],
) -> Result<Arc<dyn Any + Send + Sync>, RemotePropsError>
pub fn instantiate( &self, manifest: &str, bytes: &[u8], ) -> Result<Arc<dyn Any + Send + Sync>, RemotePropsError>
Reconstruct an actor from a (manifest, bytes) pair.
pub fn manifests(&self) -> Vec<String>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Trait Implementations§
Source§impl Clone for RemotePropsRegistry
impl Clone for RemotePropsRegistry
Source§fn clone(&self) -> RemotePropsRegistry
fn clone(&self) -> RemotePropsRegistry
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 moreSource§impl Default for RemotePropsRegistry
impl Default for RemotePropsRegistry
Source§fn default() -> RemotePropsRegistry
fn default() -> RemotePropsRegistry
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RemotePropsRegistry
impl !RefUnwindSafe for RemotePropsRegistry
impl Send for RemotePropsRegistry
impl Sync for RemotePropsRegistry
impl Unpin for RemotePropsRegistry
impl UnsafeUnpin for RemotePropsRegistry
impl !UnwindSafe for RemotePropsRegistry
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