elemental-object 0.1.0

TypeId-based object pool for hotreloadable, cross-runtime shared state management.
Documentation
1
2
3
4
5
6
7
8
9
10
11
use async_trait::async_trait;
use std::{any::Any, sync::Arc};

#[async_trait]
pub trait InstantObject: Send + Sync {
    type Output: Any + Send + Sync;
    async fn create() -> Self::Output;
    async fn destroy(_this: Arc<Self::Output>) {
        // NO-OP
    }
}