pub trait Namespace {
// Required methods
fn name(&self) -> &str;
fn register<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 self,
name: &'life1 str,
mesh: &'life2 T,
) -> Pin<Box<dyn Future<Output = Result<(), NamespaceError>> + Send + 'async_trait>>
where T: 'async_trait + Registrable,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
fn get<'life0, 'life1, 'async_trait, T>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<T, NamespaceError>> + Send + 'async_trait>>
where T: 'async_trait + Registrable,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn unregister<'life0, 'life1, 'async_trait, T>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), NamespaceError>> + Send + 'async_trait>>
where T: 'async_trait + Registrable,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
fn contains<'life0, 'life1, 'async_trait, T>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, NamespaceError>> + Send + 'async_trait>>
where T: 'async_trait + Registrable,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}Expand description
A namespace for registering and looking up meshes.
Namespaces provide isolation for mesh names. A mesh registered as “foo” in namespace “a.b.c” does not conflict with “foo” in namespace “x.y.z”.
The full key for a registered mesh is {namespace}.{kind}.{name}, e.g.,
my.namespace.actor.workers.
Required Methods§
Sourcefn register<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 self,
name: &'life1 str,
mesh: &'life2 T,
) -> Pin<Box<dyn Future<Output = Result<(), NamespaceError>> + Send + 'async_trait>>where
T: 'async_trait + Registrable,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn register<'life0, 'life1, 'life2, 'async_trait, T>(
&'life0 self,
name: &'life1 str,
mesh: &'life2 T,
) -> Pin<Box<dyn Future<Output = Result<(), NamespaceError>> + Send + 'async_trait>>where
T: 'async_trait + Registrable,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Register a mesh under the given name.
The mesh type determines the kind (host, proc, or actor) automatically
via the Registrable trait.
Sourcefn get<'life0, 'life1, 'async_trait, T>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<T, NamespaceError>> + Send + 'async_trait>>where
T: 'async_trait + Registrable,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait, T>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<T, NamespaceError>> + Send + 'async_trait>>where
T: 'async_trait + Registrable,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Lookup a mesh by name.
The mesh type must be specified (e.g., ns.get::<ProcMeshRef>("name")).
Sourcefn unregister<'life0, 'life1, 'async_trait, T>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), NamespaceError>> + Send + 'async_trait>>where
T: 'async_trait + Registrable,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn unregister<'life0, 'life1, 'async_trait, T>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), NamespaceError>> + Send + 'async_trait>>where
T: 'async_trait + Registrable,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Unregister a mesh by name.
Sourcefn contains<'life0, 'life1, 'async_trait, T>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, NamespaceError>> + Send + 'async_trait>>where
T: 'async_trait + Registrable,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn contains<'life0, 'life1, 'async_trait, T>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool, NamespaceError>> + Send + 'async_trait>>where
T: 'async_trait + Registrable,
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if a mesh exists in this namespace.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.