Trait RuntimeTrait

Source
pub trait RuntimeTrait {
    // Required methods
    fn create<'async_trait>(
        id: RuntimeId,
    ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
       where Self: Sized + 'async_trait;
    fn execute<'life0, 'async_trait, F>(
        &'life0 self,
        target_id: RuntimeId,
        f: F,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where F: Future<Output = Result<()>> + Send + 'static + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn execute_local<'life0, 'async_trait, F>(
        &'life0 self,
        f: F,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where F: Future<Output = Result<()>> + Send + 'static + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn register_handler<'life0, 'async_trait, H>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
       where H: 'async_trait + MessageHandler,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn register_instance<'life0, 'async_trait, T>(
        &'life0 self,
        instance: T,
    ) -> Pin<Box<dyn Future<Output = ObjectRef<T>> + Send + 'async_trait>>
       where T: Identity + Any + Send + Sync + 'static + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn get_instance<'life0, 'async_trait, T>(
        &'life0 self,
        id: InstanceId,
    ) -> Pin<Box<dyn Future<Output = Result<Arc<RwLock<T>>, String>> + Send + 'async_trait>>
       where T: Identity + Any + Send + Sync + 'static + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn take_instance<'life0, 'async_trait, T>(
        &'life0 self,
        id: InstanceId,
    ) -> Pin<Box<dyn Future<Output = Option<T>> + Send + 'async_trait>>
       where T: Identity + Any + Send + Sync + 'static + 'async_trait,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn call<'life0, 'async_trait, T>(
        &'life0 self,
        target_id: RuntimeId,
        args: T::Input,
    ) -> Pin<Box<dyn Future<Output = Result<T::Output>> + Send + 'async_trait>>
       where T: 'async_trait + MessageHandler,
             Self: 'async_trait,
             'life0: 'async_trait;
    fn inventory<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = Vec<InventoryItem>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}

Required Methods§

Source

fn create<'async_trait>( id: RuntimeId, ) -> Pin<Box<dyn Future<Output = Result<Self>> + Send + 'async_trait>>
where Self: Sized + 'async_trait,

Source

fn execute<'life0, 'async_trait, F>( &'life0 self, target_id: RuntimeId, f: F, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where F: Future<Output = Result<()>> + Send + 'static + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Source

fn execute_local<'life0, 'async_trait, F>( &'life0 self, f: F, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where F: Future<Output = Result<()>> + Send + 'static + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Source

fn register_handler<'life0, 'async_trait, H>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where H: 'async_trait + MessageHandler, Self: 'async_trait, 'life0: 'async_trait,

Source

fn register_instance<'life0, 'async_trait, T>( &'life0 self, instance: T, ) -> Pin<Box<dyn Future<Output = ObjectRef<T>> + Send + 'async_trait>>
where T: Identity + Any + Send + Sync + 'static + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Source

fn get_instance<'life0, 'async_trait, T>( &'life0 self, id: InstanceId, ) -> Pin<Box<dyn Future<Output = Result<Arc<RwLock<T>>, String>> + Send + 'async_trait>>
where T: Identity + Any + Send + Sync + 'static + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Source

fn take_instance<'life0, 'async_trait, T>( &'life0 self, id: InstanceId, ) -> Pin<Box<dyn Future<Output = Option<T>> + Send + 'async_trait>>
where T: Identity + Any + Send + Sync + 'static + 'async_trait, Self: 'async_trait, 'life0: 'async_trait,

Source

fn call<'life0, 'async_trait, T>( &'life0 self, target_id: RuntimeId, args: T::Input, ) -> Pin<Box<dyn Future<Output = Result<T::Output>> + Send + 'async_trait>>
where T: 'async_trait + MessageHandler, Self: 'async_trait, 'life0: 'async_trait,

Source

fn inventory<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Vec<InventoryItem>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

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.

Implementors§